Skip to content

Commit

Permalink
fix: create the miner account if not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
AshinGau committed Nov 26, 2024
1 parent 611b561 commit 12652cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use revm::{
primitives::{Account, AccountInfo, Bytecode, EvmState, B256, BLOCK_HASH_HISTORY, U256},
CacheState, Database, DatabaseCommit, DatabaseRef, TransitionAccount, TransitionState,
};
use revm_primitives::KECCAK_EMPTY;
use std::{
collections::{btree_map, hash_map, BTreeMap, HashMap},
sync::{
Expand Down Expand Up @@ -624,6 +625,13 @@ where
}
info.balance = info.balance.saturating_add(U256::from(inc_rewards));
balance = info.balance;
} else if inc_rewards != 0 {
result = Ok(Some(AccountInfo::new(
U256::from(inc_rewards),
0,
KECCAK_EMPTY,
Bytecode::default(),
)));
}
}
if address != self.coinbase || self.raw_transfer {
Expand Down

0 comments on commit 12652cf

Please sign in to comment.