Skip to content

Commit

Permalink
Merge pull request #180 from kcalvinalvin/2024-05-07-fix-udata-fetch-…
Browse files Browse the repository at this point in the history
…for-watchonly-wallet

wallet: fix how leafdatas are fetched
  • Loading branch information
kcalvinalvin authored May 7, 2024
2 parents 37eb522 + 2a63a4c commit 561a5d1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wallet/watchonly.go
Original file line number Diff line number Diff line change
Expand Up @@ -1334,9 +1334,14 @@ func (m *WatchOnlyWalletManager) NotifyNewTransactions(txns []*mempool.TxDesc) {
txHash := tx.Tx.Hash()
log.Debugf("NotifyNewTransactions: received new tx: %s\n", txHash.String())

lds := tx.Tx.MsgTx().UData.LeafDatas
// Fetch the leaf datas for this tx.
lds, err := m.config.TxMemPool.FetchLeafDatas(txHash)
if err != nil {
log.Warnf("NotifyNewTransactions: failed to fetch leafdatas for tx %s", txHash.String())
continue
}
if lds == nil {
log.Warnf("NotifyNewTransactions: received tx %s with no Udata", txHash.String())
log.Warnf("NotifyNewTransactions: fetch nil leafdatas for tx %s", txHash.String())
continue
}
if len(lds) != len(tx.Tx.MsgTx().TxIn) {
Expand Down

0 comments on commit 561a5d1

Please sign in to comment.