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 { ...@@ -103,10 +103,14 @@ export class WorkerBee implements IWorkerBee {
const listener = txObserver.provideBlockHeaderData().subscribe({ const listener = txObserver.provideBlockHeaderData().subscribe({
next(val) { next(val) {
observer.next?.({ const transaction = val.transactions[txId] ?? val.transactions[legacyId]!;
transaction: val.transactions[apiTx.id]!, if( transaction!== undefined) {
block: val.block listener.unsubscribe();
}); observer.next?.({
transaction,
block: val.block
});
}
}, },
error(val) { error(val) {
observer.error?.(val); observer.error?.(val);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment