Skip to content

Commit

Permalink
Fix GetMempoolTx bug returning no entries
Browse files Browse the repository at this point in the history
This was broken by PR 393, which changed how txids are determined.
  • Loading branch information
Larry Ruane committed Jul 15, 2022
1 parent db2795a commit d2b83d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ type (
// many more fields but these are the only ones we current need.
ZcashdRpcReplyGetrawtransaction struct {
Hex string
Txid string
Height int
}

Expand Down
5 changes: 5 additions & 0 deletions frontend/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,11 @@ func (s *lwdStreamer) GetMempoolTx(exclude *walletrpc.Exclude, resp walletrpc.Co
}
newmempoolMap[txidstr] = &walletrpc.CompactTx{}
if tx.HasShieldedElements() {
txidBytes, err := hex.DecodeString(txidstr)
if err != nil {
return err
}
tx.SetTxID(txidBytes)
newmempoolMap[txidstr] = tx.ToCompact( /* height */ 0)
}
}
Expand Down

0 comments on commit d2b83d7

Please sign in to comment.