Alter logging of a possible db inconsitency in addresses column

This commit is contained in:
Martin Boehm 2020-01-29 23:54:20 +01:00
parent 47173774f6
commit fd4181d03f

View File

@ -181,12 +181,9 @@ func (w *Worker) GetTransactionFromBchainTx(bchainTx *bchain.Tx, height int, spe
return nil, errors.Annotatef(err, "txCache.GetTransaction %v", bchainVin.Txid) return nil, errors.Annotatef(err, "txCache.GetTransaction %v", bchainVin.Txid)
} }
// mempool transactions are not in TxAddresses but confirmed should be there, log a problem // mempool transactions are not in TxAddresses but confirmed should be there, log a problem
if bchainTx.Confirmations > 0 { // ignore when Confirmations==1, it may be just a timing problem
inSync, _, _ := w.is.GetSyncState() if bchainTx.Confirmations > 1 {
// backend can report tx as confirmed, however blockbook is still syncing (!inSync), in this case do not log a problem glog.Warning("DB inconsistency: tx ", bchainVin.Txid, ": not found in txAddresses, confirmations ", bchainTx.Confirmations)
if bchainTx.Confirmations != 1 || inSync {
glog.Warning("DB inconsistency: tx ", bchainVin.Txid, ": not found in txAddresses")
}
} }
if len(otx.Vout) > int(vin.Vout) { if len(otx.Vout) > int(vin.Vout) {
vout := &otx.Vout[vin.Vout] vout := &otx.Vout[vin.Vout]