Skip to content
Snippets Groups Projects
Commit 1a4fcd43 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

WorkerBee.broadcast should trigger a subscriber only when transaction has been found in a block

parent e0dd4e7b
No related branches found
No related tags found
1 merge request!30Added dedicated test for WorkerBee.broadcast method
......@@ -103,10 +103,14 @@ export class WorkerBee implements IWorkerBee {
const listener = txObserver.provideBlockHeaderData().subscribe({
next(val) {
observer.next?.({
transaction: val.transactions[apiTx.id]!,
block: val.block
});
const transaction = val.transactions[txId] ?? val.transactions[legacyId]!;
if( transaction!== undefined) {
listener.unsubscribe();
observer.next?.({
transaction,
block: val.block
});
}
},
error(val) {
observer.error?.(val);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment