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:
aba94c8
)
submit tx protocol verify (#447)
author
Paladz
<yzhu101@uottawa.ca>
Mon, 25 Nov 2019 03:04:00 +0000
(11:04 +0800)
committer
GitHub
<noreply@github.com>
Mon, 25 Nov 2019 03:04:00 +0000
(11:04 +0800)
protocol/tx.go
patch
|
blob
|
history
diff --git
a/protocol/tx.go
b/protocol/tx.go
index
bdd3516
..
5c3af6a
100644
(file)
--- a/
protocol/tx.go
+++ b/
protocol/tx.go
@@
-49,6
+49,14
@@
func (c *Chain) validateTx(tx *types.Tx, bh *types.BlockHeader) (bool, error) {
return false, err
}
+ txVerifyResult := &bc.TxVerifyResult{StatusFail: err != nil}
+ for _, p := range c.subProtocols {
+ if err := p.ValidateTx(tx, txVerifyResult); err != nil {
+ c.txPool.AddErrCache(&tx.ID, err)
+ return false, err
+ }
+ }
+
if err != nil {
log.WithFields(log.Fields{"module": logModule, "tx_id": tx.Tx.ID.String(), "error": err}).Info("transaction status fail")
}