aboutsummaryrefslogtreecommitdiff
path: root/core/state/snapshot/account.go
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-09-16 22:54:37 -0400
committerDeterminant <[email protected]>2020-09-16 22:54:37 -0400
commited839907e592ad25e6119e145e7e05ca78b00fcd (patch)
tree1235df2fcf794c391afb33cc2dd80926469e2c7e /core/state/snapshot/account.go
parent5370b602abea0415f7609f19e3f44d5c9366e5bd (diff)
...
Diffstat (limited to 'core/state/snapshot/account.go')
-rw-r--r--core/state/snapshot/account.go20
1 files changed, 11 insertions, 9 deletions
diff --git a/core/state/snapshot/account.go b/core/state/snapshot/account.go
index b92e942..303c2fc 100644
--- a/core/state/snapshot/account.go
+++ b/core/state/snapshot/account.go
@@ -29,17 +29,19 @@ import (
// or slim-snapshot format which replaces the empty root and code hash as nil
// byte slice.
type Account struct {
- Nonce uint64
- Balance *big.Int
- Root []byte
- CodeHash []byte
+ Nonce uint64
+ Balance *big.Int
+ Root []byte
+ CodeHash []byte
+ IsMultiCoin bool
}
// SlimAccount converts a state.Account content into a slim snapshot account
-func SlimAccount(nonce uint64, balance *big.Int, root common.Hash, codehash []byte) Account {
+func SlimAccount(nonce uint64, balance *big.Int, root common.Hash, codehash []byte, isMultiCoin bool) Account {
slim := Account{
- Nonce: nonce,
- Balance: balance,
+ Nonce: nonce,
+ Balance: balance,
+ IsMultiCoin: isMultiCoin,
}
if root != emptyRoot {
slim.Root = root[:]
@@ -52,8 +54,8 @@ func SlimAccount(nonce uint64, balance *big.Int, root common.Hash, codehash []by
// SlimAccountRLP converts a state.Account content into a slim snapshot
// version RLP encoded.
-func SlimAccountRLP(nonce uint64, balance *big.Int, root common.Hash, codehash []byte) []byte {
- data, err := rlp.EncodeToBytes(SlimAccount(nonce, balance, root, codehash))
+func SlimAccountRLP(nonce uint64, balance *big.Int, root common.Hash, codehash []byte, isMultiCoin bool) []byte {
+ data, err := rlp.EncodeToBytes(SlimAccount(nonce, balance, root, codehash, isMultiCoin))
if err != nil {
panic(err)
}