aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/blockchain.go17
-rw-r--r--core/state/statedb.go9
-rw-r--r--examples/multicoin/main.go3
-rw-r--r--plugin/evm/vm.go4
-rw-r--r--rpc/types.go7
5 files changed, 26 insertions, 14 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index b3a7ffa..82e3b6c 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -2492,13 +2492,12 @@ func (bc *BlockChain) SubscribeBlockProcessingEvent(ch chan<- bool) event.Subscr
}
func (bc *BlockChain) ManualHead(hash common.Hash) error {
- return bc.FastSyncCommitHead(hash)
- //block := bc.GetBlockByHash(hash)
- //if block == nil {
- // return errors.New("block not found")
- //}
- //bc.chainmu.Lock()
- //defer bc.chainmu.Unlock()
- //bc.writeHeadBlock(block)
- //return nil
+ block := bc.GetBlockByHash(hash)
+ if block == nil {
+ return errors.New("block not found")
+ }
+ bc.chainmu.Lock()
+ defer bc.chainmu.Unlock()
+ bc.writeHeadBlock(block)
+ return nil
}
diff --git a/core/state/statedb.go b/core/state/statedb.go
index b472bd7..81be542 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -579,10 +579,11 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
return nil
}
data = &Account{
- Nonce: acc.Nonce,
- Balance: acc.Balance,
- CodeHash: acc.CodeHash,
- Root: common.BytesToHash(acc.Root),
+ Nonce: acc.Nonce,
+ Balance: acc.Balance,
+ CodeHash: acc.CodeHash,
+ IsMultiCoin: acc.IsMultiCoin,
+ Root: common.BytesToHash(acc.Root),
}
if len(data.CodeHash) == 0 {
data.CodeHash = emptyCodeHash
diff --git a/examples/multicoin/main.go b/examples/multicoin/main.go
index fc379d4..bfad5ca 100644
--- a/examples/multicoin/main.go
+++ b/examples/multicoin/main.go
@@ -64,6 +64,9 @@ func main() {
genKey := coreth.NewKeyFromECDSA(hk)
config.Genesis = genesisBlock
+ config.TrieCleanCache += config.SnapshotCache
+ config.SnapshotCache = 0
+
// grab the control of block generation and disable auto uncle
config.Miner.ManualMining = true
config.Miner.ManualUncle = true
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go
index 2b78d43..c6bc728 100644
--- a/plugin/evm/vm.go
+++ b/plugin/evm/vm.go
@@ -244,6 +244,10 @@ func (vm *VM) Initialize(
config := eth.DefaultConfig
config.ManualCanonical = true
config.Genesis = g
+ // disable the experimental snapshot feature from geth
+ config.TrieCleanCache += config.SnapshotCache
+ config.SnapshotCache = 0
+
config.Miner.ManualMining = true
config.Miner.DisableUncle = true
diff --git a/rpc/types.go b/rpc/types.go
index 6575203..3ee46f3 100644
--- a/rpc/types.go
+++ b/rpc/types.go
@@ -148,13 +148,18 @@ func (bnh *BlockNumberOrHash) UnmarshalJSON(data []byte) error {
bnh.BlockNumber = &bn
return nil
case "latest":
- bn := LatestBlockNumber
+ //*bn = LatestBlockNumber
+ bn := AcceptedBlockNumber
bnh.BlockNumber = &bn
return nil
case "pending":
bn := PendingBlockNumber
bnh.BlockNumber = &bn
return nil
+ case "accepted":
+ bn := AcceptedBlockNumber
+ bnh.BlockNumber = &bn
+ return nil
default:
if len(input) == 66 {
hash := common.Hash{}