Save index from tx notifications to utxo store.

This commit is contained in:
Josh Rickmar 2013-09-04 16:36:48 -04:00
parent 2d5950299f
commit 79d1491ac4

6
cmd.go
View file

@ -273,6 +273,11 @@ func (w *BtcWallet) ReqNewTxsForAddress(addr string) {
log.Error("Tx Handler: Unspecified transaction hash.") log.Error("Tx Handler: Unspecified transaction hash.")
return false return false
} }
index, ok := v["index"].(float64)
if !ok {
log.Error("Tx Handler: Unspecified transaction index.")
return false
}
amt, ok := v["amount"].(float64) amt, ok := v["amount"].(float64)
if !ok { if !ok {
log.Error("Tx Handler: Unspecified amount.") log.Error("Tx Handler: Unspecified amount.")
@ -321,6 +326,7 @@ func (w *BtcWallet) ReqNewTxsForAddress(addr string) {
Height: int64(height), Height: int64(height),
} }
copy(u.Out.Hash[:], txhash[:]) copy(u.Out.Hash[:], txhash[:])
u.Out.Index = uint32(index)
copy(u.Addr[:], receiver) copy(u.Addr[:], receiver)
w.UtxoStore.Lock() w.UtxoStore.Lock()