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:
parent
fb06a6bd04
commit
146e92edc1
3 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
# RPC API Specification
|
# RPC API Specification
|
||||||
|
|
||||||
Version: 2.0.0
|
Version: 2.0.1
|
||||||
|
|
||||||
**Note:** This document assumes the reader is familiar with gRPC concepts.
|
**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)
|
Refer to the [gRPC Concepts documentation](http://www.grpc.io/docs/guides/concepts.html)
|
||||||
|
|
|
@ -43,10 +43,10 @@ import (
|
||||||
|
|
||||||
// Public API version constants
|
// Public API version constants
|
||||||
const (
|
const (
|
||||||
semverString = "2.0.0"
|
semverString = "2.0.1"
|
||||||
semverMajor = 2
|
semverMajor = 2
|
||||||
semverMinor = 0
|
semverMinor = 0
|
||||||
semverPatch = 0
|
semverPatch = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
// translateError creates a new gRPC error with an appropiate error code for
|
// translateError creates a new gRPC error with an appropiate error code for
|
||||||
|
|
|
@ -118,8 +118,8 @@ func makeTxSummary(w *Wallet, details *wtxmgr.TxDetails) TransactionSummary {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outputs := make([]TransactionSummaryOutput, 0, len(details.MsgTx.TxOut))
|
outputs := make([]TransactionSummaryOutput, 0, len(details.MsgTx.TxOut))
|
||||||
var credIndex int
|
|
||||||
for i := range details.MsgTx.TxOut {
|
for i := range details.MsgTx.TxOut {
|
||||||
|
credIndex := len(outputs)
|
||||||
mine := len(details.Credits) > credIndex && details.Credits[credIndex].Index == uint32(i)
|
mine := len(details.Credits) > credIndex && details.Credits[credIndex].Index == uint32(i)
|
||||||
if !mine {
|
if !mine {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Reference in a new issue