From 715fd22de90c434a763f6a819af45565ba5dd70c Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Fri, 21 Mar 2014 15:43:31 -0500 Subject: [PATCH] Bootstrap unspents with rescan request's outpoints. --- rpcwebsocket.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcwebsocket.go b/rpcwebsocket.go index 052b6991..5baf26d5 100644 --- a/rpcwebsocket.go +++ b/rpcwebsocket.go @@ -1597,7 +1597,7 @@ func handleRescan(wsc *wsClient, icmd btcjson.Cmd) (interface{}, *btcjson.Error) var ripemd160Hash [ripemd160.Size]byte var compressedPubkey [33]byte var uncompressedPubkey [65]byte - for addrStr := range cmd.Addresses { + for _, addrStr := range cmd.Addresses { addr, err := btcutil.DecodeAddress(addrStr, activeNetParams.btcnet) if err != nil { jsonErr := btcjson.Error{ @@ -1641,6 +1641,9 @@ func handleRescan(wsc *wsClient, icmd btcjson.Cmd) (interface{}, *btcjson.Error) lookups.fallbacks[addrStr] = struct{}{} } } + for _, outpoint := range cmd.OutPoints { + lookups.unspent[*outpoint] = struct{}{} + } minBlock := int64(cmd.BeginBlock) maxBlock := int64(cmd.EndBlock)