Skip to content

fix: set acceptDelayedBroadcast: false on all createAction calls#3

Merged
MatiasJF merged 5 commits intomainfrom
fixes/delayedBroadcast
Mar 5, 2026
Merged

fix: set acceptDelayedBroadcast: false on all createAction calls#3
MatiasJF merged 5 commits intomainfrom
fixes/delayedBroadcast

Conversation

@MatiasJF
Copy link
Copy Markdown
Collaborator

@MatiasJF MatiasJF commented Mar 5, 2026

Description of Changes

Every createAction call in @bsv/simple passed options: { randomizeOutputs: false } but did not set acceptDelayedBroadcast. The @bsv/sdk defaults acceptDelayedBroadcast to true, which means no transaction created by @bsv/simple was ever immediately broadcast — they were all queued as unsent for a background monitor that typically doesn't exist in scripts, CLI tools, or short-lived server processes.

This PR adds acceptDelayedBroadcast: false to all 11 createAction call sites across 4 files:

File Count Methods
src/core/WalletCore.ts 2 send(), fundServerWallet()
src/modules/tokens.ts 4 createToken(), sendToken(), redeemToken(), sendTokenViaMessageBox()
src/modules/did.ts 2 createDID() (issuance), spendChainOutput() (used by createDID, updateDID, deactivateDID)
src/modules/overlay.ts 3 advertiseSHIP(), advertiseSLAP(), broadcastAction()

Linked Issues / Tickets

N/A — discovered during integration testing with @bsv/simple/server.

Testing Procedure

Manually tested with two scripts in a separate project (Build_EZ_on_BSV):

Payment test (2-pay.ts) — Creates a ServerWallet, funds it via a browser wallet, then sends a P2PKH payment. After the fix, sendWithResults returns status: 'unproven' (broadcast, awaiting confirmation) instead of 'unsent' (stuck in queue).

  • Verified txid ca6f832d05836f5568ea9677ffa5ab4a63280ce131db1576ed15951c256fc35e on WhatsOnChain.

DID test (7-did.ts) — Creates a ServerWallet, funds it, then calls createDID(). After the fix, the issuance transaction broadcasts immediately and the DID resolves successfully.

  • Verified DID did:bsv:3ba78a2f2fc454c73c2ba651ef7ff4166585ce5edc3fd5e0475aa9b2c21d4705 created and resolved.

  • I have tested manually in my local environment

Checklist

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have run npm run lint one final time before requesting a review
  • I have fixed all linter errors to ensure these changes are compliant with ts-standard
  • I have run npm version patch so that my changes will trigger a new version to be released when they are merged

@MatiasJF MatiasJF changed the title change acceptDelayedBroadcast to false fix: set acceptDelayedBroadcast: false on all createAction calls Mar 5, 2026
MatiasJF added 2 commits March 5, 2026 19:44
Apply the same acceptDelayedBroadcast: false fix to the 2 remaining
createAction calls in credentials.ts (revocation UTXO creation and
revocation spend). Without this, revocation transactions were queued
as unsent instead of broadcasting immediately.
@MatiasJF MatiasJF enabled auto-merge March 5, 2026 18:48
@MatiasJF MatiasJF merged commit 1da0c45 into main Mar 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants