From 146e92edc19d7789db03c88c80e11cbf05bd5aa8 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Wed, 4 May 2016 15:01:44 -0400 Subject: [PATCH] Fix credit slice indexing for transaction notifications. Previously, this would always check a transaction output index against the 0th credit's index. --- rpc/documentation/api.md | 2 +- rpc/rpcserver/server.go | 4 ++-- wallet/notifications.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rpc/documentation/api.md b/rpc/documentation/api.md index 565291c..2e10bcb 100644 --- a/rpc/documentation/api.md +++ b/rpc/documentation/api.md @@ -1,6 +1,6 @@ # RPC API Specification -Version: 2.0.0 +Version: 2.0.1 **Note:** This document assumes the reader is familiar with gRPC concepts. Refer to the [gRPC Concepts documentation](http://www.grpc.io/docs/guides/concepts.html) diff --git a/rpc/rpcserver/server.go b/rpc/rpcserver/server.go index 24a2475..f3d4f65 100644 --- a/rpc/rpcserver/server.go +++ b/rpc/rpcserver/server.go @@ -43,10 +43,10 @@ import ( // Public API version constants const ( - semverString = "2.0.0" + semverString = "2.0.1" semverMajor = 2 semverMinor = 0 - semverPatch = 0 + semverPatch = 1 ) // translateError creates a new gRPC error with an appropiate error code for diff --git a/wallet/notifications.go b/wallet/notifications.go index 7098c9d..76de9a8 100644 --- a/wallet/notifications.go +++ b/wallet/notifications.go @@ -118,8 +118,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