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

miner: actually sign aggregate transaction inputs #65

Merged
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
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
Loading