Skip to content

Commit

Permalink
Fix eth_getTransactionCount behavior for unknown acccounts
Browse files Browse the repository at this point in the history
Return starting account nonce for unknown accounts instead of error

Signed-off-by: Alexander Jung <104335080+AlexRamRam@users.noreply.github.com>
  • Loading branch information
AlexRamRam committed Aug 21, 2023
1 parent 2b5fd84 commit 4220e05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parsec/agent/runners/evm/http_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ namespace cbdc::parsec::agent::rpc {
auto& updates = std::get<return_type>(res);
auto it = updates.find(runner_params);

if(it == updates.end()) {
if(it == updates.end() || it->second.size() == 0) {
// For accounts that don't exist yet, return 1
ret["result"] = to_hex_trimmed(evmc::uint256be(1));
callback(ret);
Expand Down

0 comments on commit 4220e05

Please sign in to comment.