mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-28 11:36:17 +00:00
ce09c82b25
It's used in two places now: * Blockchain.AddBlock() This one does transaction duplication check of its own, doing it in Verify() is just a waste of time. Merkle tree root hash value check is still relevant though * Block.DecodeBinary() We're decoding blocks for the following purposes: - on restore from dump The block will be added to the chain via AddBlock() and that will do a full check of it (if configured to do so) - on retrieving the block from the DB (DAO) We trust the DB, if it's gone wild, this check won't really help - on receiving the block via P2P It's gonna be put into block queue and then end up in AddBlock() which will check it - on receiving the block via RPC (submitblock) It is to be passed into AddBlock() - on receiving the block via RPC in a client That's the only problematic case probably, but RPC client has to trust the server and it can check for the signature if it really cares. Or a separate in-client check might be added. As we can see nothing really requires this verification to be done the way it is now, AddBlock can just have a Merkle check and DecodeBinary can do fine without it at all. |
||
---|---|---|
.. | ||
block | ||
blockchainer | ||
dao | ||
interop | ||
mempool | ||
mpt | ||
native | ||
state | ||
storage | ||
test_data | ||
transaction | ||
blockchain.go | ||
blockchain_test.go | ||
doc.go | ||
gas_price.go | ||
header_hash_list.go | ||
helper_test.go | ||
interop_neo.go | ||
interop_neo_test.go | ||
interop_system.go | ||
interop_system_test.go | ||
interops.go | ||
interops_test.go | ||
native_contract_test.go | ||
native_neo_test.go | ||
native_policy_test.go | ||
opcode_price.go | ||
prometheus.go | ||
util.go | ||
util_test.go |