GetModifiedAccountsByNumber 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.
(startNum uint64, endNum *uint64)
| 420 | // |
| 421 | // With one parameter, returns the list of accounts modified in the specified block. |
| 422 | func (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum *uint64) ([]common.Address, error) { |
| 423 | var startBlock, endBlock *types.Block |
| 424 | |
| 425 | startBlock = api.cpc.blockchain.GetBlockByNumber(startNum) |
| 426 | if startBlock == nil { |
| 427 | return nil, fmt.Errorf("start block %x not found", startNum) |
| 428 | } |
| 429 | |
| 430 | if endNum == nil { |
| 431 | endBlock = startBlock |
| 432 | startBlock = api.cpc.blockchain.GetBlockByHash(startBlock.ParentHash()) |
| 433 | if startBlock == nil { |
| 434 | return nil, fmt.Errorf("block %x has no parent", endBlock.Number()) |
| 435 | } |
| 436 | } else { |
| 437 | endBlock = api.cpc.blockchain.GetBlockByNumber(*endNum) |
| 438 | if endBlock == nil { |
| 439 | return nil, fmt.Errorf("end block %d not found", *endNum) |
| 440 | } |
| 441 | } |
| 442 | return api.getModifiedAccounts(startBlock, endBlock) |
| 443 | } |
| 444 | |
| 445 | // GetModifiedAccountsByHash returns all accounts that have changed between the |
| 446 | // two blocks specified. A change is defined as a difference in nonce, balance, |
nothing calls this directly
no test coverage detected