Skip to content

Commit

Permalink
Merge pull request #65 from DaMatrix/dev/sign_miner_aggregate_txn
Browse files Browse the repository at this point in the history
miner: actually sign aggregate transaction inputs
  • Loading branch information
BHouwens authored May 13, 2024
2 parents 7b8941e + 325aa4a commit 087a27b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use tracing_futures::Instrument;
use tw_chain::primitives::asset::{Asset, TokenAmount};
use tw_chain::primitives::block::{self, BlockHeader};
use tw_chain::primitives::transaction::Transaction;
use tw_chain::utils::transaction_utils::{construct_tx_core, construct_tx_hash};
use tw_chain::utils::transaction_utils::{construct_tx_core, construct_tx_hash, update_input_signatures};

/// Key for last pow coinbase produced
pub const LAST_COINBASE_KEY: &str = "LastCoinbaseKey";
Expand Down Expand Up @@ -1414,6 +1414,10 @@ impl MinerNode {
.await
.unwrap();

// Sign the inputs
let key_material = self.wallet_db.get_key_material(&tx_ins);
let tx_ins = update_input_signatures(&tx_ins, &tx_outs, &key_material);

// Aggregation address is last generated address,
// which is generated by passing `None` as the `excess_address`
// to `fetch_tx_ins_and_tx_outs_merge_input_addrs`
Expand Down

0 comments on commit 087a27b

Please sign in to comment.