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 (from parent 1:
4e50d5a
)
fix bug for cancel vote (#145)
author
wz
<mars@bytom.io>
Mon, 10 Jun 2019 06:40:28 +0000
(14:40 +0800)
committer
Paladz
<yzhu101@uottawa.ca>
Mon, 10 Jun 2019 06:40:28 +0000
(14:40 +0800)
account/builder.go
patch
|
blob
|
history
diff --git
a/account/builder.go
b/account/builder.go
index
027e1fb
..
af0c0a1
100644
(file)
--- a/
account/builder.go
+++ b/
account/builder.go
@@
-309,7
+309,12
@@
func (a *spendUTXOAction) Build(ctx context.Context, b *txbuilder.TemplateBuilde
// UtxoToInputs convert an utxo to the txinput
func UtxoToInputs(signer *signers.Signer, u *UTXO) (*types.TxInput, *txbuilder.SigningInstruction, error) {
// UtxoToInputs convert an utxo to the txinput
func UtxoToInputs(signer *signers.Signer, u *UTXO) (*types.TxInput, *txbuilder.SigningInstruction, error) {
- txInput := types.NewSpendInput(nil, u.SourceID, u.AssetID, u.Amount, u.SourcePos, u.ControlProgram)
+ txInput := &types.TxInput{}
+ if u.Vote == nil {
+ txInput = types.NewSpendInput(nil, u.SourceID, u.AssetID, u.Amount, u.SourcePos, u.ControlProgram)
+ } else {
+ txInput = types.NewUnvoteInput(nil, u.SourceID, u.AssetID, u.Amount, u.SourcePos, u.ControlProgram, u.Vote)
+ }
sigInst := &txbuilder.SigningInstruction{}
if signer == nil {
return txInput, sigInst, nil
sigInst := &txbuilder.SigningInstruction{}
if signer == nil {
return txInput, sigInst, nil