Skip to content

Commit 442d455

Browse files
committed
Return err in spendable_outputs
1 parent 5c07dd3 commit 442d455

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightning/src/chain/keysinterface.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,9 @@ impl KeysManager {
10361036
}
10371037
let witness_script = bitcoin::Address::p2pkh(&pubkey, Network::Testnet).script_pubkey();
10381038
let payment_script = bitcoin::Address::p2wpkh(&pubkey, Network::Testnet).expect("uncompressed key found").script_pubkey();
1039-
assert_eq!(payment_script, output.script_pubkey);
1039+
1040+
if payment_script != output.script_pubkey { return Err(()); };
1041+
10401042
let sighash = hash_to_message!(&bip143::SigHashCache::new(&spend_tx).signature_hash(input_idx, &witness_script, output.value, SigHashType::All)[..]);
10411043
let sig = secp_ctx.sign(&sighash, &secret.private_key.key);
10421044
spend_tx.input[input_idx].witness.push(sig.serialize_der().to_vec());

0 commit comments

Comments
 (0)