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:
@@ -62,7 +62,7 @@ class MnemonicWalletDiscovery
|
||||
* set discovery_complete.
|
||||
* @return int Number of address rows created or updated
|
||||
*/
|
||||
public function discoverActivated(WalletMnemonic $mnemonic, bool $force = false): int
|
||||
public function discoverActivated(WalletMnemonic $mnemonic, bool $force = false, bool $notify = true): int
|
||||
{
|
||||
$phrase = $mnemonic->mnemonic;
|
||||
if ($phrase === null || trim($phrase) === '') {
|
||||
@@ -97,7 +97,7 @@ class MnemonicWalletDiscovery
|
||||
$saved = [];
|
||||
$covered = []; // chain => true when linked / miss-cached / probed this run
|
||||
|
||||
$created = ChainHttpTimeout::using(self::PROBE_TIMEOUT_SECONDS, function () use ($mnemonic, $phrase, $source, $linkedChainTypes, $force, &$saved, &$covered) {
|
||||
$created = ChainHttpTimeout::using(self::PROBE_TIMEOUT_SECONDS, function () use ($mnemonic, $phrase, $source, $linkedChainTypes, $force, $notify, &$saved, &$covered) {
|
||||
foreach (self::CHAINS as $spec) {
|
||||
$chain = $spec['chain'];
|
||||
|
||||
@@ -135,7 +135,7 @@ class MnemonicWalletDiscovery
|
||||
}
|
||||
}
|
||||
|
||||
if ($saved !== []) {
|
||||
if ($notify && $saved !== []) {
|
||||
$this->telegram->notifyCollectableAddresses($saved);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user