Skip to content

Commit 03e0e77

Browse files
committed
Merge #23: Fix example spend amount
49ec983 Fix example spend amount (Tobin C. Harding) Pull request description: In the segwit signing example we are using the incorrect value when creating the signature - we should be using the utxo amount (input amount) not the spend amount (output spend amount). Also fixed in `rust-bitcoin` PR [#2696](https://github.com/rust-bitcoin/rust-bitcoin). ACKs for top commit: apoelstra: ACK 49ec983 Tree-SHA512: e7487ca04ab579b044e36a6a171c12a5f27872d7aaf95f0114d18872226d2f74174bdb7dd03072c4feecf9c25bb99fc97cdd20c0d76515c51413b95b2a8e7ce8
2 parents 8235f80 + 49ec983 commit 03e0e77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cookbook/src/tx_segwit-v0.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ fn main() {
204204
let sighash_type = EcdsaSighashType::All;
205205
let mut sighasher = SighashCache::new(&mut unsigned_tx);
206206
let sighash = sighasher
207-
.p2wpkh_signature_hash(input_index, &dummy_utxo.script_pubkey, SPEND_AMOUNT, sighash_type)
207+
.p2wpkh_signature_hash(input_index, &dummy_utxo.script_pubkey, DUMMY_UTXO_AMOUNT, sighash_type)
208208
.expect("failed to create sighash");
209209

210210
// Sign the sighash using the secp256k1 library (exported by rust-bitcoin).

0 commit comments

Comments
 (0)