eth, miner: removed unnecessary state.Copy()

* miner: removed unnecessary state.Copy()

* eth: made use of new miner method without state copying

* miner: More documentation about new method
This commit is contained in:
Martin Holst Swende
2016-11-30 10:48:48 +01:00
committed by Péter Szilágyi
parent 3363a1c227
commit 9f8bc00cf5
3 changed files with 26 additions and 2 deletions

View File

@ -56,7 +56,7 @@ func (b *EthApiBackend) SetHead(number uint64) {
func (b *EthApiBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error) {
// Pending block is only known by the miner
if blockNr == rpc.PendingBlockNumber {
block, _ := b.eth.miner.Pending()
block := b.eth.miner.PendingBlock()
return block.Header(), nil
}
// Otherwise resolve and return the block
@ -69,7 +69,7 @@ func (b *EthApiBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNum
func (b *EthApiBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error) {
// Pending block is only known by the miner
if blockNr == rpc.PendingBlockNumber {
block, _ := b.eth.miner.Pending()
block := b.eth.miner.PendingBlock()
return block, nil
}
// Otherwise resolve and return the block