diff --git a/src/processor/mine.rs b/src/processor/mine.rs index e941040..efc036f 100644 --- a/src/processor/mine.rs +++ b/src/processor/mine.rs @@ -79,7 +79,7 @@ pub fn process_mine<'a, 'info>( // Calculate the hash from the provided nonce let noise_data = noise_info.data.borrow(); - let hx = drillx::hash(&proof.hash, &args.nonce, &noise_data); + let hx = drillx::hash(&proof.challenge, &args.nonce, &noise_data); drop(noise_data); // Validate hash satisfies the minimnum difficulty @@ -139,7 +139,7 @@ pub fn process_mine<'a, 'info>( proof.balance = proof.balance.saturating_add(reward); // Hash recent slot hash into the next challenge to prevent pre-mining attacks - proof.hash = hashv(&[ + proof.challenge = hashv(&[ hx.as_slice(), &slot_hashes_info.data.borrow()[0..size_of::()], ]) diff --git a/src/processor/register.rs b/src/processor/register.rs index acaf52d..4ad7c15 100644 --- a/src/processor/register.rs +++ b/src/processor/register.rs @@ -59,7 +59,7 @@ pub fn process_register<'a, 'info>( let proof = Proof::try_from_bytes_mut(&mut proof_data)?; proof.authority = *signer.key; proof.balance = 0; - proof.hash = hashv(&[ + proof.challenge = hashv(&[ signer.key.as_ref(), &slot_hashes_info.data.borrow()[0..size_of::()], ]) diff --git a/src/state/proof.rs b/src/state/proof.rs index 24ea148..e2913d1 100644 --- a/src/state/proof.rs +++ b/src/state/proof.rs @@ -18,8 +18,8 @@ pub struct Proof { /// The quantity of tokens this miner has staked or earned. pub balance: u64, - /// The proof's current hash. - pub hash: [u8; 32], + /// The current mining challenge. + pub challenge: [u8; 32], /// The last slot ore was deposited into this account. pub last_deposit_slot: u64,