• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版5b12cb76ee6c7d399b7c0cda09a4b469a00e2e9b (tree)
时间2020-03-16 15:38:57
作者paladz <453256728@qq.c...>
Commiterpaladz

Log Message

ban status fail for flash swap

更改概述

差异

--- a/protocol/validation/block.go
+++ b/protocol/validation/block.go
@@ -101,6 +101,13 @@ func ValidateBlock(b *bc.Block, parent *types.BlockHeader, rewards []state.Coinb
101101 return errors.Wrapf(validateResult.err, "validate of transaction %d of %d", i, len(b.Transactions))
102102 }
103103
104+ // for support flash swap running on vapor, status fail txs need to be
105+ // rejected. Or the attacker can steal BTM from any BTM/* trade pair by
106+ // using status fail charge fee rule.
107+ if b.Height >= consensus.ActiveNetParams.MovStartHeight && validateResult.err != nil {
108+ return errors.New("the chain currently didn't support status fail tx")
109+ }
110+
104111 if err := b.TransactionStatus.SetStatus(i, validateResult.err != nil); err != nil {
105112 return err
106113 }
Show on old repository browser