Files
bitcoin/src
fanquake b1de33d29a Merge #16821: Fix bug where duplicate PSBT keys are accepted
9743432034 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 9743432034
  instagibbs:
    code review ACK 9743432034

Tree-SHA512: 34f4b34c8e6561c6a6ab745cdd319f6687eac6f7cecc735c94035eeca8c5157e17a27f2ae853dbaa6634fcd5a8f4e1c6cc13d1ebd7e563459665d72bb147cc1e
2019-10-09 09:18:27 -04:00
..
2019-01-26 12:45:48 -05:00
2018-09-07 08:21:14 -04:00
2018-12-29 10:15:01 +01:00
2019-10-01 12:19:31 +09:00
2018-07-27 07:15:02 -04:00
2019-09-25 20:56:38 +02:00
2018-07-27 07:15:02 -04:00
2019-02-22 17:38:45 -08:00
2019-02-22 17:38:45 -08:00
2019-04-10 12:16:52 +01:00
2018-08-11 09:34:47 +03:00
2019-04-09 17:53:08 -04:00
2019-10-02 10:39:14 -04:00
2018-07-27 07:15:02 -04:00
2019-03-27 13:59:50 +01:00
2018-07-27 07:15:02 -04:00
2019-06-20 12:12:24 -04:00
2018-07-27 07:15:02 -04:00
2018-07-27 07:15:02 -04:00
2018-07-27 07:15:02 -04:00
2018-07-27 07:15:02 -04:00
2019-10-02 10:39:14 -04:00
2019-10-02 10:39:14 -04:00
2018-07-27 07:15:02 -04:00
2018-07-27 07:15:02 -04:00
2018-07-27 11:52:18 -07:00
2019-09-10 07:53:09 -06:00
2019-09-25 10:56:00 -04:00
2018-07-27 07:15:02 -04:00
2018-07-27 07:15:02 -04:00
2019-10-02 10:39:14 -04:00
2018-07-27 07:15:02 -04:00