From 5b3d124de2557fe1fb5c510ac87d356b7ab85fde Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 17 Jul 2018 18:55:58 -0700 Subject: [PATCH] chain: also accept map[wire.OutPoint]btcutil.Address for bitcoind rescans In this commit, we update bitcoind to also accept a mapping from outpoint to address for its implementation of the recan RPC. We do this as in the near future, when bitcoind implements BIP 158 indexing, then we'll be able to utilize that to do rescans. --- chain/bitcoind.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/chain/bitcoind.go b/chain/bitcoind.go index 028483e..0e10ec1 100644 --- a/chain/bitcoind.go +++ b/chain/bitcoind.go @@ -229,7 +229,8 @@ func (c *BitcoindClient) notifying() bool { // LoadTxFilter updates the transaction watchlists for the client. Acceptable // arguments after `reset` are any combination of []btcutil.Address, -// []wire.OutPoint, []*wire.OutPoint, []chainhash.Hash, and []*chainhash.Hash. +// []wire.OutPoint, []*wire.OutPoint, []chainhash.Hash, +// map[wire.OutPoint]btcutil.Address, and []*chainhash.Hash. func (c *BitcoindClient) LoadTxFilter(reset bool, watchLists ...interface{}) error { @@ -254,16 +255,25 @@ func (c *BitcoindClient) LoadTxFilter(reset bool, for _, watchList := range watchLists { switch list := watchList.(type) { + + case map[wire.OutPoint]btcutil.Address: + sendList(list) + case []wire.OutPoint: sendList(list) + case []*wire.OutPoint: sendList(list) + case []btcutil.Address: sendList(list) + case []chainhash.Hash: sendList(list) + case []*chainhash.Hash: sendList(list) + default: log.Warnf("Couldn't add item to filter: unknown type") }