From 79d1491ac4a9014b9e508db7a2164779729c6f1f Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Wed, 4 Sep 2013 16:36:48 -0400 Subject: [PATCH] Save index from tx notifications to utxo store. --- cmd.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd.go b/cmd.go index 04dc33d..3f1a664 100644 --- a/cmd.go +++ b/cmd.go @@ -273,6 +273,11 @@ func (w *BtcWallet) ReqNewTxsForAddress(addr string) { log.Error("Tx Handler: Unspecified transaction hash.") return false } + index, ok := v["index"].(float64) + if !ok { + log.Error("Tx Handler: Unspecified transaction index.") + return false + } amt, ok := v["amount"].(float64) if !ok { log.Error("Tx Handler: Unspecified amount.") @@ -321,6 +326,7 @@ func (w *BtcWallet) ReqNewTxsForAddress(addr string) { Height: int64(height), } copy(u.Out.Hash[:], txhash[:]) + u.Out.Index = uint32(index) copy(u.Addr[:], receiver) w.UtxoStore.Lock()