Daemons will rarely arbitrarily drop blocks that it previously considered valid. This is a bug in the daemon or maybe only in testnet. This fix treats those dropped blocks as orhpans.
This commit is contained in:
parent
c71e9d71c3
commit
d3e2057ec9
|
@ -137,13 +137,24 @@ function SetupForPool(logger, poolOptions){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
txDetails = txDetails.filter(function(tx){
|
txDetails.forEach(function(tx, i){
|
||||||
if (tx.error || !tx.result){
|
if (tx.error && tx.error.code === -5){
|
||||||
|
/* Block was dropped from coin daemon even after it happily accepted it earlier.
|
||||||
|
Must be a bug in the daemon code or maybe only something that happens in testnet.
|
||||||
|
We handle this by treating it like an orphaned block. */
|
||||||
|
logger.error(logSystem, logComponent,
|
||||||
|
'Daemon dropped a previously valid block - we are treating it as an orphaned block');
|
||||||
|
|
||||||
|
//These changes to the tx will convert it from dropped to orphan
|
||||||
|
tx.result = {
|
||||||
|
txid: rounds[i].txHash,
|
||||||
|
details: [{category: 'orphan'}]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else if (tx.error || !tx.result){
|
||||||
logger.error(logSystem, logComponent,
|
logger.error(logSystem, logComponent,
|
||||||
'error with requesting transaction from block daemon: ' + JSON.stringify(tx));
|
'error with requesting transaction from block daemon: ' + JSON.stringify(tx));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue