Alter logging of a possible db inconsitency in addresses column

pull/380/head
Martin Boehm 2020-01-29 23:54:20 +01:00
parent 47173774f6
commit fd4181d03f
1 changed files with 3 additions and 6 deletions

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)
}
// mempool transactions are not in TxAddresses but confirmed should be there, log a problem
if bchainTx.Confirmations > 0 {
inSync, _, _ := w.is.GetSyncState()
// backend can report tx as confirmed, however blockbook is still syncing (!inSync), in this case do not log a problem
if bchainTx.Confirmations != 1 || inSync {
glog.Warning("DB inconsistency: tx ", bchainVin.Txid, ": not found in txAddresses")
}
// ignore when Confirmations==1, it may be just a timing problem
if bchainTx.Confirmations > 1 {
glog.Warning("DB inconsistency: tx ", bchainVin.Txid, ": not found in txAddresses, confirmations ", bchainTx.Confirmations)
}
if len(otx.Vout) > int(vin.Vout) {
vout := &otx.Vout[vin.Vout]