-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Destroy UTXO payload #374
base: master
Are you sure you want to change the base?
Conversation
core/store/ChainStore/ChainStore.go
Outdated
} | ||
for assetId, value := range results { | ||
if _, ok := quantities[assetId]; !ok { | ||
quantities[assetId] += value * -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usage expression quantities[assetId] -= value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
1624443
to
61a7af6
Compare
approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Destory UTXO tx, needn't check TX balance.
thanks for review. added balance check exception when DestroyUTXO payload. but the outputs should be 0. could you helps to check it again,thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment
@@ -192,7 +192,7 @@ func CheckTransactionBalance(Tx *tx.Transaction) error { | |||
return errors.New("Invalide transaction UTXO output.") | |||
} | |||
} | |||
if Tx.TxType == tx.IssueAsset { | |||
if Tx.TxType == tx.IssueAsset || Tx.TxType == tx.DestroyUTXO { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Destory UTXO should check the output, not input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
1f1253f
to
a24e651
Compare
add Destroy UTXO payload Signed-off-by: luodanwg <[email protected]>
add validation check of should be destroyed by asset issuer. |
The UTXO owner can Destory self controled UTXOs
and will reduce the value of asset total issued quantity.
Signed-off-by: luodanwg [email protected]