Fix credit slice indexing for transaction notifications.

Previously, this would always check a transaction output index against
the 0th credit's index.
This commit is contained in:
Josh Rickmar 2016-05-04 15:01:44 -04:00 committed by Olaoluwa Osuntokun
parent 61e96a69e4
commit 504b045332

View file

@ -119,8 +119,8 @@ func makeTxSummary(w *Wallet, details *wtxmgr.TxDetails) TransactionSummary {
}
}
outputs := make([]TransactionSummaryOutput, 0, len(details.MsgTx.TxOut))
var credIndex int
for i := range details.MsgTx.TxOut {
credIndex := len(outputs)
mine := len(details.Credits) > credIndex && details.Credits[credIndex].Index == uint32(i)
if !mine {
continue