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

Add log for the result of Flash transactions #2906

Merged
merged 1 commit into from
Jan 25, 2022
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
27 changes: 15 additions & 12 deletions source/agora/flash/Channel.d
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,10 @@ LOuter: while (1)
funding_tx_signed.inputs[0].unlock
= genKeyUnlock(this.kp.sign(this.conf.funding_tx.getChallenge()));

log.info("Publishing funding tx..");
this.txPublisher(funding_tx_signed);
auto result = this.txPublisher(funding_tx_signed);
log.info("{}: Publishing funding tx: {}. Result: {}",
this.own_pk.flashPrettify, this.funding_tx_signed.hashFull.flashPrettify,
result);
}

this.trigger_utxo = UTXO.getHash(update_pair.update_tx.hashFull(), 0);
Expand Down Expand Up @@ -1984,9 +1986,10 @@ LOuter: while (1)
this.pending_close.validated = true;

// todo: schedule this
log.info("{}: Publishing close tx: {}",
this.own_pk.flashPrettify, this.pending_close.tx.hashFull.flashPrettify);
this.txPublisher(this.pending_close.tx);
auto result = this.txPublisher(this.pending_close.tx);
log.info("{}: Publishing close tx: {}. Result: {}",
this.own_pk.flashPrettify, this.pending_close.tx.hashFull.flashPrettify,
result);
return true;
}

Expand Down Expand Up @@ -2260,9 +2263,10 @@ LOuter: while (1)
else
update_tx.inputs[idx].unlock = genKeyUnlock(fee_sig);

log.info("{}: Publishing update tx {}: {}",
this.own_pk.flashPrettify, update.seq_id, update_tx.hashFull().flashPrettify);
this.txPublisher(update_tx);
auto result = this.txPublisher(update_tx);
log.info("{}: Publishing update tx {}: {}. Result: {}",
this.own_pk.flashPrettify, update.seq_id, update_tx.hashFull().flashPrettify,
result);
return update_tx;
}

Expand Down Expand Up @@ -2312,11 +2316,10 @@ LOuter: while (1)
else
input.unlock = genKeyUnlock(fee_sig);

log.info("{}: Publishing last settle tx {}: {}",
auto result = this.txPublisher(settle_tx);
log.info("{}: Publishing last settle tx {}: {}. Result: {}",
this.own_pk.flashPrettify, this.channel_updates.length,
settle_tx.hashFull().flashPrettify);

this.txPublisher(settle_tx);
settle_tx.hashFull().flashPrettify, result);
return settle_tx;
}

Expand Down