chainntnfs: return an error when witness stack is empty

This commit adds a check when receiving transactions from
`BitcoindClient` so an error is returned when empty witness is found.
This commit is contained in:
yyforyongyu
2023-07-11 17:58:42 +08:00
parent 971d3d8d9c
commit 28c3c835bf
7 changed files with 139 additions and 14 deletions

View File

@@ -536,7 +536,12 @@ func (b *BtcdNotifier) handleRelevantTx(tx *btcutil.Tx,
// If this is a mempool spend, we'll ask the mempool notifier to hanlde
// it.
if mempool {
b.memNotifier.ProcessRelevantSpendTx(tx)
err := b.memNotifier.ProcessRelevantSpendTx(tx)
if err != nil {
chainntnfs.Log.Errorf("Unable to process transaction "+
"%v: %v", tx.Hash(), err)
}
return
}