Transaction tracking revamped.

Blockchain block arrow.
This commit is contained in:
Simon Lindh authored and wiz committed 2020-02-26 03:28:57 +09:00
1 parent 98391580b3
commit 6e724d4203
15 files changed
+232 -145

No files matched your search

+8 -4
View File
@@ -90,8 +90,12 @@ class Server {
client['want-stats'] = parsedMessage.data.indexOf('stats') > -1;
}
if (parsedMessage && parsedMessage.txId && /^[a-fA-F0-9]{64}$/.test(parsedMessage.txId)) {
client['txId'] = parsedMessage.txId;
if (parsedMessage && parsedMessage['track-tx']) {
if (/^[a-fA-F0-9]{64}$/.test(parsedMessage['track-tx'])) {
client['track-tx'] = parsedMessage['track-tx'];
} else {
client['track-tx'] = null;
}
}
if (parsedMessage.action === 'init') {
@@ -139,8 +143,8 @@ class Server {
return;
}
if (client['txId'] && txIds.indexOf(client['txId']) > -1) {
client['txId'] = null;
if (client['track-tx'] && txIds.indexOf(client['track-tx']) > -1) {
client['track-tx'] = null;
client.send(JSON.stringify({
'block': block,
'txConfirmed': true,