This repository was archived by the owner on Feb 3, 2025. It is now read-only.
File tree 2 files changed +16
-5
lines changed
2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,8 @@ pub enum ActivityItem {
169
169
OnChain ( TransactionDetails ) ,
170
170
Lightning ( Box < MutinyInvoice > ) ,
171
171
ChannelClosed ( ChannelClosure ) ,
172
+ // /// A payjoin proposal is posted to the directory but not yet broadcast from the sender
173
+ // PendingPayjoin,
172
174
}
173
175
174
176
impl ActivityItem {
Original file line number Diff line number Diff line change @@ -334,15 +334,15 @@ impl<S: MutinyStorage> OnChainWallet<S> {
334
334
335
335
// Outputs may be substituted for e.g. batching at this stage
336
336
// We're not doing this yet.
337
-
337
+ let mut wallet = self
338
+ . wallet
339
+ . try_write ( )
340
+ . map_err ( |_| Error :: Server ( MutinyError :: WalletSigningFailed . into ( ) ) ) ?;
338
341
let payjoin_proposal = provisional_payjoin. finalize_proposal (
339
342
|psbt : & payjoin:: bitcoin:: psbt:: Psbt | {
340
343
// convert from payjoin::bitcoin 30.0
341
344
let mut psbt = PartiallySignedTransaction :: from_str ( & psbt. to_string ( ) ) . unwrap ( ) ;
342
- let wallet = self
343
- . wallet
344
- . try_read ( )
345
- . map_err ( |_| Error :: Server ( MutinyError :: WalletSigningFailed . into ( ) ) ) ?;
345
+
346
346
wallet
347
347
. sign ( & mut psbt, SignOptions :: default ( ) )
348
348
. map_err ( |_| Error :: Server ( MutinyError :: WalletSigningFailed . into ( ) ) ) ?;
@@ -354,6 +354,15 @@ impl<S: MutinyStorage> OnChainWallet<S> {
354
354
Some ( payjoin:: bitcoin:: FeeRate :: MIN ) ,
355
355
) ?;
356
356
let payjoin_proposal_psbt = payjoin_proposal. psbt ( ) ;
357
+ let proposal_psbt_29 =
358
+ bitcoin:: psbt:: PartiallySignedTransaction :: from_str ( & payjoin_proposal_psbt. to_string ( ) )
359
+ . map_err ( |_| Error :: Server ( MutinyError :: WalletOperationFailed . into ( ) ) ) ?;
360
+ wallet
361
+ . insert_tx (
362
+ proposal_psbt_29. extract_tx ( ) ,
363
+ ConfirmationTime :: unconfirmed ( crate :: utils:: now ( ) . as_secs ( ) ) ,
364
+ )
365
+ . map_err ( |_| Error :: Server ( MutinyError :: WalletOperationFailed . into ( ) ) ) ?;
357
366
log:: debug!(
358
367
"Receiver's Payjoin proposal PSBT Rsponse: {:#?}" ,
359
368
payjoin_proposal_psbt
You can’t perform that action at this time.
0 commit comments