Skip to content

Commit

Permalink
fix: use user thread in for listeners in ChainLocksHandler and Instan…
Browse files Browse the repository at this point in the history
…tSendManager

Signed-off-by: HashEngineering <[email protected]>
  • Loading branch information
HashEngineering committed Mar 5, 2024
1 parent b3e0660 commit ac8f7f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public ChainLocksHandler(Context context) {
public void setBlockChain(AbstractBlockChain blockChain, AbstractBlockChain headerChain) {
this.blockChain = blockChain;
this.headerChain = headerChain;
this.blockChain.addNewBestBlockListener(Threading.SAME_THREAD, this.newBestBlockListener);
this.blockChain.addNewBestBlockListener(this.newBestBlockListener);
this.quorumSigningManager = context.signingManager;
this.quorumInstantSendManager = context.instantSendManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public InstantSendManager(Context context, InstantSendDatabase db, boolean runWi
public void setBlockChain(AbstractBlockChain blockChain, @Nullable PeerGroup peerGroup) {
this.blockChain = blockChain;
this.blockChain.addTransactionReceivedListener(this.transactionReceivedInBlockListener);
this.blockChain.addNewBestBlockListener(Threading.SAME_THREAD, this.newBestBlockListener);
this.blockChain.addNewBestBlockListener(this.newBestBlockListener);
if (peerGroup != null) {
peerGroup.addOnTransactionBroadcastListener(this.transactionBroadcastListener);
}
context.chainLockHandler.addChainLockListener(this.chainLockListener, Threading.SAME_THREAD);
context.chainLockHandler.addChainLockListener(this.chainLockListener);
}

public void close(PeerGroup peerGroup) {
Expand Down

0 comments on commit ac8f7f9

Please sign in to comment.