Skip to content

Commit

Permalink
feat: stop interactive only address from being used in mining (#6544)
Browse files Browse the repository at this point in the history
Description
---
Block use of interactive only address from being used in coinbase
builder
  • Loading branch information
SWvheerden authored Sep 10, 2024
1 parent 611f226 commit 1f18e7d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion base_layer/core/src/transactions/coinbase_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use log::*;
use tari_common_types::{
key_branches::TransactionKeyManagerBranch,
tari_address::TariAddress,
tari_address::{TariAddress, TariAddressFeatures},
types::{Commitment, PrivateKey},
};
use tari_key_manager::key_manager_service::{KeyManagerInterface, KeyManagerServiceError};
Expand Down Expand Up @@ -435,6 +435,14 @@ pub async fn generate_coinbase_with_wallet_output(
range_proof_type: RangeProofType,
payment_id: PaymentId,
) -> Result<(Transaction, TransactionOutput, TransactionKernel, WalletOutput), CoinbaseBuildError> {
if !wallet_payment_address
.features()
.contains(TariAddressFeatures::create_one_sided_only())
{
return Err(CoinbaseBuildError::BuildError(
"Invalid address, address must be one-sided enabled".to_string(),
));
}
let sender_offset = key_manager
.get_next_key(TransactionKeyManagerBranch::SenderOffset.get_branch_key())
.await?;
Expand Down

0 comments on commit 1f18e7d

Please sign in to comment.