diff options
author | fanquake <fanquake@gmail.com> | 2019-10-09 09:04:30 -0400 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2019-10-09 09:18:27 -0400 |
commit | b1de33d29a2b8ca52fdc61c9969d14ae76154e63 (patch) | |
tree | d050774b0df86e236b7d649a3edee2bd82402fa5 /doc | |
parent | 97e05817d461d58ae58b998672d1c722edbd9475 (diff) | |
parent | 9743432034586385cfef87df4b377c255ed0cba8 (diff) |
Merge #16821: Fix bug where duplicate PSBT keys are accepted
9743432034586385cfef87df4b377c255ed0cba8 Fix bug where duplicate PSBT keys are accepted (John L. Jegutanis)
Pull request description:
As per the BIP 174 spec a PSBT key cannot be duplicated,
however the current code accepts key duplication.
The PSBT key/value entries can be duplicated when the value
is `empty()` or `IsNull()` for `CScript` or `CTxOut` respectively
and if those key/value entries are serialized before the non-empty ones.
For example, the following PSBT, included in the test vectors,
contains a duplicate field:
```
// magic
70736274ff
// global tx
//// key
0100
//// value
2a02000000000140420f000000000017a9146e91b72d5593e7d4391e2ff44e91e985c31641f08700000000
//// separator
00
// no inputs
// outputs
//// key PSBT_OUT_WITNESSSCRIPT
0101
//// value (empty script)
00
//// key PSBT_OUT_WITNESSSCRIPT (same as the above)
0101
//// value (an OP_RETURN script)
016a
//// separator
00
```
ACKs for top commit:
achow101:
ACK 9743432034586385cfef87df4b377c255ed0cba8
instagibbs:
code review ACK https://github.com/bitcoin/bitcoin/pull/16821/commits/9743432034586385cfef87df4b377c255ed0cba8
Tree-SHA512: 34f4b34c8e6561c6a6ab745cdd319f6687eac6f7cecc735c94035eeca8c5157e17a27f2ae853dbaa6634fcd5a8f4e1c6cc13d1ebd7e563459665d72bb147cc1e
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions