Bootstrap unspents with rescan request's outpoints.

This commit is contained in:
Josh Rickmar 2014-03-21 15:43:31 -05:00
parent de31674a8d
commit 715fd22de9

View file

@ -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)