Send empty list of transactions if data isn't available yet
This commit is contained in:
parent
967a2a4461
commit
ebda00dc74
@ -116,12 +116,10 @@ class WebsocketHandler {
|
|||||||
const index = parsedMessage['track-mempool-block'];
|
const index = parsedMessage['track-mempool-block'];
|
||||||
client['track-mempool-block'] = index;
|
client['track-mempool-block'] = index;
|
||||||
const mBlocksWithTransactions = mempoolBlocks.getMempoolBlocksWithTransactions();
|
const mBlocksWithTransactions = mempoolBlocks.getMempoolBlocksWithTransactions();
|
||||||
if (mBlocksWithTransactions[index]) {
|
response['projected-block-transactions'] = {
|
||||||
response['projected-block-transactions'] = {
|
index: index,
|
||||||
index: index,
|
blockTransactions: mBlocksWithTransactions[index]?.transactions || [],
|
||||||
blockTransactions: mBlocksWithTransactions[index].transactions
|
};
|
||||||
};
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
client['track-mempool-block'] = null;
|
client['track-mempool-block'] = null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user