Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix coinbase share calculations #6571

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: fix coinbase share calculations
stringhandler committed Sep 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 84467287a67cf4be4c958bf6568057dadd9fa123
10 changes: 8 additions & 2 deletions applications/minotari_node/src/grpc/base_node_grpc_server.rs
Original file line number Diff line number Diff line change
@@ -769,9 +769,15 @@ impl tari_rpc::base_node_server::BaseNode for BaseNodeGrpcServer {
"`GetNewBlockTemplateWithCoinbases` method not made available",
));
}
trace!(target: LOG_TARGET, "Incoming GRPC request for get new block template with coinbases");
let report_error_flag = self.report_error_flag();
let request = request.into_inner();
let shares = request
.coinbases
.iter()
.map(|c| c.value.to_string())
.collect::<Vec<_>>()
.join(", ");
debug!(target: LOG_TARGET, "Incoming GRPC request for get new block template with coinbases: {}", shares);
let algo = request
.algo
.map(|algo| u64::try_from(algo.pow_algo))
@@ -849,7 +855,7 @@ impl tari_rpc::base_node_server::BaseNode for BaseNodeGrpcServer {
Status::internal("Single coinbase fees exceeded u64".to_string()),
)
})?;
prev_coinbase_value = u128::from(coinbase.value);
prev_coinbase_value += u128::from(coinbase.value);
}

let key_manager = create_memory_db_key_manager().map_err(|e| {