OSDN Git Service
(root)
/
bytom
/
vapor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4b5e427
)
fix bug for vote & normal output (#433)
author
Paladz
<yzhu101@uottawa.ca>
Fri, 1 Nov 2019 02:35:16 +0000
(10:35 +0800)
committer
GitHub
<noreply@github.com>
Fri, 1 Nov 2019 02:35:16 +0000
(10:35 +0800)
wallet/utxo.go
patch
|
blob
|
history
diff --git
a/wallet/utxo.go
b/wallet/utxo.go
index
bc60f56
..
a1b44fa
100644
(file)
--- a/
wallet/utxo.go
+++ b/
wallet/utxo.go
@@
-209,13
+209,9
@@
func txInToUtxos(tx *types.Tx, statusFail bool) []*account.UTXO {
}
func txOutToUtxos(tx *types.Tx, statusFail bool, blockHeight uint64) []*account.UTXO {
}
func txOutToUtxos(tx *types.Tx, statusFail bool, blockHeight uint64) []*account.UTXO {
- validHeight := uint64(0)
- if tx.Inputs[0].InputType() == types.CoinbaseInputType {
- validHeight = blockHeight + consensus.ActiveNetParams.CoinbasePendingBlockNumber
- }
-
utxos := []*account.UTXO{}
for i, out := range tx.Outputs {
utxos := []*account.UTXO{}
for i, out := range tx.Outputs {
+ validHeight := uint64(0)
entryOutput, err := tx.Entry(*tx.ResultIds[i])
if err != nil {
log.WithFields(log.Fields{"module": logModule, "err": err}).Error("txOutToUtxos fail on get entryOutput")
entryOutput, err := tx.Entry(*tx.ResultIds[i])
if err != nil {
log.WithFields(log.Fields{"module": logModule, "err": err}).Error("txOutToUtxos fail on get entryOutput")
@@
-228,6
+224,11
@@
func txOutToUtxos(tx *types.Tx, statusFail bool, blockHeight uint64) []*account.
if (statusFail && *out.AssetAmount().AssetId != *consensus.BTMAssetID) || out.AssetAmount().Amount == uint64(0) {
continue
}
if (statusFail && *out.AssetAmount().AssetId != *consensus.BTMAssetID) || out.AssetAmount().Amount == uint64(0) {
continue
}
+
+ if tx.Inputs[0].InputType() == types.CoinbaseInputType {
+ validHeight = blockHeight + consensus.ActiveNetParams.CoinbasePendingBlockNumber
+ }
+
utxo = &account.UTXO{
OutputID: *tx.OutputID(i),
AssetID: *out.AssetAmount().AssetId,
utxo = &account.UTXO{
OutputID: *tx.OutputID(i),
AssetID: *out.AssetAmount().AssetId,