Skip to content

Commit

Permalink
f remove impl Filter for PayjoinHan..
Browse files Browse the repository at this point in the history
  • Loading branch information
jbesraa committed Jul 17, 2024
1 parent 6e15f96 commit 8cdcfc0
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/payment/payjoin/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::PaymentDetails;

use lightning::chain::channelmonitor::ANTI_REORG_DELAY;
use lightning::chain::transaction::TransactionData;
use lightning::chain::{Confirm, Filter, WatchedOutput};
use lightning::chain::{Confirm, Filter};
use lightning::ln::channelmanager::PaymentId;
use lightning::log_error;
use lightning::util::logger::Logger;
Expand Down Expand Up @@ -75,7 +75,7 @@ impl PayjoinHandler {
))?;
let tx = original_psbt.clone().unsigned_tx;
// watch original transaction in case it gets broadcasted by the receiver
self.register_tx(&tx.txid(), Script::empty());
self.chain_source.register_tx(&tx.txid(), Script::empty());
self.event_queue.add_event(Event::PayjoinPaymentPending {
txid: tx.txid(),
amount_sats: amount.to_sat(),
Expand Down Expand Up @@ -147,7 +147,7 @@ impl PayjoinHandler {
pj_tx.waiting_first_confirmation(proposal_tx.clone())?;
let txid = proposal_tx.txid();
// watch proposal transaction
self.register_tx(&txid, Script::empty());
self.chain_source.register_tx(&txid, Script::empty());
Ok(proposal_tx)
},
None => {
Expand Down Expand Up @@ -300,17 +300,6 @@ impl PayjoinHandler {
}
}

impl Filter for PayjoinHandler {
fn register_tx(&self, txid: &Txid, _script_pubkey: &Script) {
let script = Script::empty();
self.chain_source.register_tx(txid, &script);
}

fn register_output(&self, output: WatchedOutput) {
self.chain_source.register_output(output);
}
}

impl Confirm for PayjoinHandler {
fn transactions_confirmed(&self, header: &Header, txdata: &TransactionData, height: u32) {
self.internal_transactions_confirmed(header, txdata, height);
Expand Down

0 comments on commit 8cdcfc0

Please sign in to comment.