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 /eth/api.go | |
parent | 841b2b7225a9318718c3c856a9debdf01bc4f061 (diff) |
support "accepted" as block number in JSON-RPC
Diffstat (limited to 'eth/api.go')
-rw-r--r-- | eth/api.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -28,15 +28,15 @@ import ( "strings" "time" + "github.com/ava-labs/coreth/internal/ethapi" + "github.com/ava-labs/coreth/rpc" "github.com/ava-labs/go-ethereum/common" "github.com/ava-labs/go-ethereum/common/hexutil" "github.com/ava-labs/go-ethereum/core" "github.com/ava-labs/go-ethereum/core/rawdb" "github.com/ava-labs/go-ethereum/core/state" "github.com/ava-labs/go-ethereum/core/types" - "github.com/ava-labs/coreth/internal/ethapi" "github.com/ava-labs/go-ethereum/rlp" - "github.com/ava-labs/go-ethereum/rpc" "github.com/ava-labs/go-ethereum/trie" ) @@ -271,6 +271,8 @@ func (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.Dump, error var block *types.Block if blockNr == rpc.LatestBlockNumber { block = api.eth.blockchain.CurrentBlock() + } else if blockNr == rpc.AcceptedBlockNumber { + block = api.eth.AcceptedBlock() } else { block = api.eth.blockchain.GetBlockByNumber(uint64(blockNr)) } |