HomePhabricator

Merge #11872: [rpc] createrawtransaction: Accept sorted outputs

Description

Merge #11872: [rpc] createrawtransaction: Accept sorted outputs

Summary:
PR11872 backport https://github.com/bitcoin/bitcoin/pull/11872/files
fac70134a rpc: Update createrawtransaction examples (MarcoFalke)
fa06dfce0 [rpc] createrawtransaction: Accept sorted outputs (MarcoFalke)
8acd25d85 rpc: Allow typeAny in RPCTypeCheck (MarcoFalke)

Pull request description:

The second parameter of the `createrawtransaction` is a dictionary of the outputs. This comes with at least two drawbacks:

* In case of duplicate keys, either of them might silently disappear, with no user feedback at all. A user needs to make other mistakes, but this could eventually lead to abnormal tx fees.
* A dictionary does not guarantee that keys are sorted. Again, a user needs to keep this in mind, as it could eventually lead to excessive tx fees.

Even though my scenario of loss-of-funds is unlikely to happen, I see it as a inconvenience that should be fixed.

Depends on D3072

Test Plan:
make check
test_runner.py

Reviewers: jasonbcox, Fabien, #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D3075

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on May 22 2019, 19:31
Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>Committed on May 22 2019, 20:21
markblundebergPushed on May 22 2019, 20:21
Reviewer
Restricted Project
Differential Revision
D3075: Merge #11872: [rpc] createrawtransaction: Accept sorted outputs
Parents
rABC27bc83a0e6ac: Merge #10503: Use REJECT_DUPLICATE for already known and conflicted txn
Branches
Unknown
Tags
Unknown