Skip to content

Commit

Permalink
correct filter of input for coinbase
Browse files Browse the repository at this point in the history
  • Loading branch information
tamasblummer committed Aug 23, 2019
1 parent 7f5e83f commit d3edba9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Coins {
pub fn process_unconfirmed_transaction(&mut self, master_account: &mut MasterAccount, transaction: &Transaction) -> bool {
let mut scripts: HashMap<Script, KeyDerivation> = master_account.get_scripts().collect();
let mut modified = false;
for input in transaction.input.iter().skip(1) {
for input in transaction.input.iter() {
modified |= self.remove_confirmed(&input.previous_output);
}
for (vout, output) in transaction.output.iter().enumerate() {
Expand Down Expand Up @@ -133,8 +133,10 @@ impl Coins {

let mut modified = false;
for (txnr, tx) in block.txdata.iter().enumerate() {
for input in tx.input.iter().skip(1) {
modified |= self.remove_confirmed(&input.previous_output);
if txnr > 0 { // skip coinbase
for input in tx.input.iter() {
modified |= self.remove_confirmed(&input.previous_output);
}
}
for (vout, output) in tx.output.iter().enumerate() {
let mut lookahead = Vec::new();
Expand Down

0 comments on commit d3edba9

Please sign in to comment.