Update create transaction example code

The transaction builder changed a while ago, looks like some of the
example code did not get updated.

Update the transaction creation code to use a mutable builder.
This commit is contained in:
Tobin Harding 2021-05-06 16:11:06 +10:00 committed by Alekos Filini
parent 47f26447da
commit fad0fe9f30
No known key found for this signature in database
GPG Key ID: 431401E4A4530061

View File

@ -125,12 +125,15 @@
//! wallet.sync(noop_progress(), None)?; //! wallet.sync(noop_progress(), None)?;
//! //!
//! let send_to = wallet.get_address(New)?; //! let send_to = wallet.get_address(New)?;
//! let (psbt, details) = wallet.build_tx() //! let (psbt, details) = {
//! .add_recipient(send_to.script_pubkey(), 50_000) //! let mut builder = wallet.build_tx();
//! .enable_rbf() //! builder
//! .do_not_spend_change() //! .add_recipient(send_to.script_pubkey(), 50_000)
//! .fee_rate(FeeRate::from_sat_per_vb(5.0)) //! .enable_rbf()
//! .finish()?; //! .do_not_spend_change()
//! .fee_rate(FeeRate::from_sat_per_vb(5.0))
//! builder.finish()?
//! };
//! //!
//! println!("Transaction details: {:#?}", details); //! println!("Transaction details: {:#?}", details);
//! println!("Unsigned PSBT: {}", base64::encode(&serialize(&psbt))); //! println!("Unsigned PSBT: {}", base64::encode(&serialize(&psbt)));