mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-23 17:47:29 +00:00
chain: update block filterer to map outpoints to addrs
This commit is contained in:
parent
714ac383cb
commit
bc47007c50
1 changed files with 4 additions and 4 deletions
|
@ -42,7 +42,7 @@ type BlockFilterer struct {
|
||||||
// WathcedOutPoints is a global set of outpoints being tracked by the
|
// WathcedOutPoints is a global set of outpoints being tracked by the
|
||||||
// wallet. This allows the block filterer to check for spends from an
|
// wallet. This allows the block filterer to check for spends from an
|
||||||
// outpoint we own.
|
// 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
|
// FoundExternal is a two-layer map recording the scope and index of
|
||||||
// external addresses found in a single block.
|
// external addresses found in a single block.
|
||||||
|
@ -54,7 +54,7 @@ type BlockFilterer struct {
|
||||||
|
|
||||||
// FoundOutPoints is a set of outpoints found in a single block whose
|
// FoundOutPoints is a set of outpoints found in a single block whose
|
||||||
// address belongs to the wallet.
|
// 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
|
// RelevantTxns records the transactions found in a particular block
|
||||||
// that contained matches from an address in either ExReverseFilter or
|
// that contained matches from an address in either ExReverseFilter or
|
||||||
|
@ -87,7 +87,7 @@ func NewBlockFilterer(params *chaincfg.Params,
|
||||||
|
|
||||||
foundExternal := make(map[waddrmgr.KeyScope]map[uint32]struct{})
|
foundExternal := make(map[waddrmgr.KeyScope]map[uint32]struct{})
|
||||||
foundInternal := 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{
|
return &BlockFilterer{
|
||||||
Params: params,
|
Params: params,
|
||||||
|
@ -168,7 +168,7 @@ func (bf *BlockFilterer) FilterTx(tx *wire.MsgTx) bool {
|
||||||
Index: uint32(i),
|
Index: uint32(i),
|
||||||
}
|
}
|
||||||
|
|
||||||
bf.FoundOutPoints[outPoint] = struct{}{}
|
bf.FoundOutPoints[outPoint] = addrs[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
return isRelevant
|
return isRelevant
|
||||||
|
|
Loading…
Add table
Reference in a new issue