GetModifiedAccountsByHash returns all accounts that have changed between the two blocks specified. A change is defined as a difference in nonce, balance, code hash, or storage hash. With one parameter, returns the list of accounts modified in the specified block.
(startHash common.Hash, endHash *common.Hash)
| 448 | // |
| 449 | // With one parameter, returns the list of accounts modified in the specified block. |
| 450 | func (api *PrivateDebugAPI) GetModifiedAccountsByHash(startHash common.Hash, endHash *common.Hash) ([]common.Address, error) { |
| 451 | var startBlock, endBlock *types.Block |
| 452 | startBlock = api.cpc.blockchain.GetBlockByHash(startHash) |
| 453 | if startBlock == nil { |
| 454 | return nil, fmt.Errorf("start block %x not found", startHash) |
| 455 | } |
| 456 | |
| 457 | if endHash == nil { |
| 458 | endBlock = startBlock |
| 459 | startBlock = api.cpc.blockchain.GetBlockByHash(startBlock.ParentHash()) |
| 460 | if startBlock == nil { |
| 461 | return nil, fmt.Errorf("block %x has no parent", endBlock.Number()) |
| 462 | } |
| 463 | } else { |
| 464 | endBlock = api.cpc.blockchain.GetBlockByHash(*endHash) |
| 465 | if endBlock == nil { |
| 466 | return nil, fmt.Errorf("end block %x not found", *endHash) |
| 467 | } |
| 468 | } |
| 469 | return api.getModifiedAccounts(startBlock, endBlock) |
| 470 | } |
| 471 | |
| 472 | func (api *PrivateDebugAPI) getModifiedAccounts(startBlock, endBlock *types.Block) ([]common.Address, error) { |
| 473 | if startBlock.Number().Uint64() >= endBlock.Number().Uint64() { |
nothing calls this directly
no test coverage detected