Remove public key from script sig, since it is already pushed to the stack in the redeem script.

This commit is contained in:
CalDescent 2022-05-19 19:55:08 +01:00
parent 1ce584f986
commit 9eeaf4f026

View File

@ -250,11 +250,11 @@ impl TransparentInputs {
if (!&info.secret.is_empty()) { // Redeem if (!&info.secret.is_empty()) { // Redeem
let is_refund : [u8;1] = [0]; // 0x00 (OP_FALSE) let is_refund : [u8;1] = [0]; // 0x00 (OP_FALSE)
mtx.vin[i].script_sig = Script::default() << &sig_bytes[..] << &info.pubkey[..] << &info.secret[..] << &is_refund[..] << &info.redeem_script[..]; mtx.vin[i].script_sig = Script::default() << &sig_bytes[..] << &info.secret[..] << &is_refund[..] << &info.redeem_script[..];
} }
else { // Refund else { // Refund
let is_refund : [u8;1] = [81]; // 0x51 (OP_TRUE) let is_refund : [u8;1] = [81]; // 0x51 (OP_TRUE)
mtx.vin[i].script_sig = Script::default() << &sig_bytes[..] << &info.pubkey[..] << &is_refund[..] << &info.redeem_script[..]; mtx.vin[i].script_sig = Script::default() << &sig_bytes[..] << &is_refund[..] << &info.redeem_script[..];
} }
// No longer supports P2PKH scriptSig since this is a P2SH-only implementation // No longer supports P2PKH scriptSig since this is a P2SH-only implementation