OSDN Git Service
(root)
/
bytom
/
bytom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dcbce17
)
fix(bcrp): don't allow overwrite attachEntries map when apply block (#1993)
author
DeKaiju
<longjinglv@163.com>
Mon, 28 Jun 2021 02:33:06 +0000
(10:33 +0800)
committer
GitHub
<noreply@github.com>
Mon, 28 Jun 2021 02:33:06 +0000
(10:33 +0800)
protocol/state/contract_view.go
patch
|
blob
|
history
diff --git
a/protocol/state/contract_view.go
b/protocol/state/contract_view.go
index
e4314c7
..
28e4e14
100644
(file)
--- a/
protocol/state/contract_view.go
+++ b/
protocol/state/contract_view.go
@@
-27,7
+27,9
@@
func (view *ContractViewpoint) ApplyBlock(block *types.Block) {
if program := output.ControlProgram; bcrp.IsBCRPScript(program) {
var hash [32]byte
sha3pool.Sum256(hash[:], program)
- view.AttachEntries[hash] = append(tx.ID.Bytes(), program...)
+ if _, ok := view.AttachEntries[hash]; !ok {
+ view.AttachEntries[hash] = append(tx.ID.Bytes(), program...)
+ }
}
}
}