mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-19 07:26:47 +00:00
fee
This commit is contained in:
@@ -184,6 +184,9 @@ pub struct CommitEvent {
|
||||
/// The total amount of hashpower this miner has committed to the block.
|
||||
pub permit_commitment: u64,
|
||||
|
||||
/// The fee paid per hash.
|
||||
pub fee: u64,
|
||||
|
||||
/// The timestamp of the event.
|
||||
pub ts: i64,
|
||||
}
|
||||
@@ -209,6 +212,9 @@ pub struct UncommitEvent {
|
||||
/// The total amount of hashpower this miner has committed to the block.
|
||||
pub permit_commitment: u64,
|
||||
|
||||
/// The fee paid per hash.
|
||||
pub fee: u64,
|
||||
|
||||
/// The timestamp of the event.
|
||||
pub ts: i64,
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ pub fn process_commit(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResul
|
||||
amount,
|
||||
block_commitment: block.total_committed,
|
||||
permit_commitment: permit.commitment,
|
||||
fee,
|
||||
ts: clock.unix_timestamp,
|
||||
}
|
||||
.to_bytes(),
|
||||
|
||||
@@ -61,6 +61,8 @@ pub fn process_uncommit(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramRes
|
||||
block.total_committed -= amount;
|
||||
|
||||
// Close permit account, if empty.
|
||||
let fee = permit.fee;
|
||||
let commitment = permit.commitment;
|
||||
if permit.commitment == 0 {
|
||||
permit_info.close(signer_info)?;
|
||||
}
|
||||
@@ -74,8 +76,9 @@ pub fn process_uncommit(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramRes
|
||||
authority: *signer_info.key,
|
||||
block_id: block.id,
|
||||
block_commitment: block.total_committed,
|
||||
permit_commitment: permit.commitment,
|
||||
permit_commitment: commitment,
|
||||
amount,
|
||||
fee,
|
||||
ts: clock.unix_timestamp,
|
||||
}
|
||||
.to_bytes(),
|
||||
|
||||
Reference in New Issue
Block a user