1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-05-26 12:10:14 +00:00

Put "BIP-xyz" comments on the right file

Luke Dashjr 2021-05-17 15:30:45 +00:00
parent f6a80c39f9
commit 5d0a32eb59

@ -1,20 +0,0 @@
I already reported on #lightning-dev but worth documenting here in case anybody else is playing around with it, this blank `prevout` at
https://github.com/cdecker/bitcoin/blob/noinput/src/script/interpreter.cpp#L1217
is used when `SIGHASH_NOINPUT` is the sighash type, but the input index that's being set is actually `0xFFFFFFFF` instead of `0x00000000` as the bip suggests, can be seen here :
https://github.com/cdecker/bitcoin/blob/noinput/src/primitives/transaction.h#L24
Something like the following will have to be added for the implementation to be compatible with the bip
```diff
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index 3df1fc0c9..43e398581 100644
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -1230,6 +1230,8 @@ uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsig
if (!noinput) {
prevout = txTo.vin[nIn].prevout;
script = scriptCode;
+ } else {
+ prevout.n = (uint32_t)0;
}
if ((nHashType & 0x1f) != SIGHASH_SINGLE && (nHashType & 0x1f) != SIGHASH_NONE) {
```