diff options
| author | Adam Soltys <[email protected]> | 2026-06-27 10:52:51 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-27 10:52:51 -0700 |
| commit | 381ca347bab721965c682a630ed61a7c236ebed5 (patch) | |
| tree | 2dcf9637226e8c95d104db5a3042efabd1ecd9c8 | |
| parent | 58f9c5e8cef7deba3e3054124ba4d2bd992db646 (diff) | |
| parent | 45d7d233c26edc07d7ad0e68c310d02f0626fbe9 (diff) | |
| download | coinosv3-381ca347bab721965c682a630ed61a7c236ebed5.tar.gz coinosv3-381ca347bab721965c682a630ed61a7c236ebed5.zip | |
Merge branch 'master' into boltz-swaps
| -rw-r--r-- | src/wallet.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wallet.js b/src/wallet.js index 2f65904..bc24393 100644 --- a/src/wallet.js +++ b/src/wallet.js @@ -1607,7 +1607,10 @@ export class Wallet { // not responses). Newline-terminated per the protocol. _rpcSend(method, params) { if (!this._ws || this._ws.readyState !== 1) return; - const id = ++this._rpcId; + // Coerce to a number defensively: a non-numeric _rpcId serializes id as + // null, which the response matcher (msg.id != null) drops — silently + // breaking every data call (and thus reconciles). + const id = (this._rpcId = (this._rpcId || 0) + 1); try { this._ws.send(JSON.stringify({ id, method, params }) + '\n'); } catch {} @@ -1642,7 +1645,7 @@ export class Wallet { _rpcSendCall(method, params, attempt = 0) { return new Promise((resolve, reject) => { if (this.offline) { reject(new Error('offline')); return; } - const id = ++this._rpcId; + const id = (this._rpcId = (this._rpcId || 0) + 1); if (!this._pending) this._pending = new Map(); const timer = setTimeout(() => { if (!this._pending.delete(id)) return; |
