diff options
author | Determinant <[email protected]> | 2019-10-01 13:28:55 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-10-01 13:28:55 -0400 |
commit | bc43122f54ed8de21f74ee6393549c9554d732e8 (patch) | |
tree | 549fffb8771dd280b29eec1e8691e67eb4b24895 /coreth.go | |
parent | 841b2b7225a9318718c3c856a9debdf01bc4f061 (diff) |
support "accepted" as block number in JSON-RPC
Diffstat (limited to 'coreth.go')
-rw-r--r-- | coreth.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -29,6 +29,7 @@ type ETHChain struct { backend *eth.Ethereum cb *dummy.ConsensusCallbacks mcb *miner.MinerCallbacks + bcb *eth.BackendCallbacks } func isLocalBlock(block *types.Block) bool { @@ -52,8 +53,9 @@ func NewETHChain(config *eth.Config, nodecfg *node.Config, etherBase *common.Add } cb := new(dummy.ConsensusCallbacks) mcb := new(miner.MinerCallbacks) - backend, _ := eth.New(&ctx, config, cb, mcb, chainDB) - chain := ÐChain{backend: backend, cb: cb, mcb: mcb} + bcb := new(eth.BackendCallbacks) + backend, _ := eth.New(&ctx, config, cb, mcb, bcb, chainDB) + chain := ÐChain{backend: backend, cb: cb, mcb: mcb, bcb: bcb} if etherBase == nil { etherBase = &common.Address{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -125,6 +127,10 @@ func (self *ETHChain) SetOnFinalizeAndAssemble(cb dummy.OnFinalizeAndAssembleCal self.cb.OnFinalizeAndAssemble = cb } +func (self *ETHChain) SetOnQueryAcceptedBlock(cb func() *types.Block) { + self.bcb.OnQueryAcceptedBlock = cb +} + // Returns a new mutable state based on the current HEAD block. func (self *ETHChain) CurrentState() (*state.StateDB, error) { return self.backend.BlockChain().State() |