Skip to content

Commit

Permalink
chain: update block filterer to map outpoints to addrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef committed Jul 17, 2018
1 parent 714ac38 commit bc47007
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chain/block_filterer.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type BlockFilterer struct {
// WathcedOutPoints is a global set of outpoints being tracked by the
// wallet. This allows the block filterer to check for spends from an
// outpoint we own.
WatchedOutPoints map[wire.OutPoint]struct{}
WatchedOutPoints map[wire.OutPoint]btcutil.Address

// FoundExternal is a two-layer map recording the scope and index of
// external addresses found in a single block.
Expand All @@ -54,7 +54,7 @@ type BlockFilterer struct {

// FoundOutPoints is a set of outpoints found in a single block whose
// address belongs to the wallet.
FoundOutPoints map[wire.OutPoint]struct{}
FoundOutPoints map[wire.OutPoint]btcutil.Address

// RelevantTxns records the transactions found in a particular block
// that contained matches from an address in either ExReverseFilter or
Expand Down Expand Up @@ -87,7 +87,7 @@ func NewBlockFilterer(params *chaincfg.Params,

foundExternal := make(map[waddrmgr.KeyScope]map[uint32]struct{})
foundInternal := make(map[waddrmgr.KeyScope]map[uint32]struct{})
foundOutPoints := make(map[wire.OutPoint]struct{})
foundOutPoints := make(map[wire.OutPoint]btcutil.Address)

return &BlockFilterer{
Params: params,
Expand Down Expand Up @@ -168,7 +168,7 @@ func (bf *BlockFilterer) FilterTx(tx *wire.MsgTx) bool {
Index: uint32(i),
}

bf.FoundOutPoints[outPoint] = struct{}{}
bf.FoundOutPoints[outPoint] = addrs[0]
}

return isRelevant
Expand Down

0 comments on commit bc47007

Please sign in to comment.