[RPC]Move transaction combining from signrawtransaction to new RPC #10571

Merged
merged 1 commit into from Jul 20, 2017

Conversation

Projects
None yet
7 participants
Contributor

achow101 commented Jun 10, 2017

Create a combinerawtransaction RPC which accepts a json array of hex raw transactions to combine them into one transaction. Signrawtransaction is changed to no longer combine transactions and only accept one transaction at a time.

The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed.

This is part of #10570

Owner

sipa commented Jun 12, 2017

Concept ACK. However, this does break backward compatibility with an undocumented but apparently intentional and tested feature. Does this require deprecation first?

Member

jnewbery commented Jun 28, 2017

Concept feedback: combining transactions seems like a utility. Is it possible to add it to bitcoin-tx rather than add a utility-only RPC?

Owner

sipa commented Jun 28, 2017

It is not a utility-only RPC. It needs access to the UTXO set.

laanwj added this to the 0.15.0 milestone Jul 6, 2017

Owner

sipa commented Jul 15, 2017

utACK c710eb9

@gmaxwell

ACK

@morcos

morcos approved these changes Jul 17, 2017

utACK c710eb9

although at least the documentation in the RPC test should probably be corrected

src/rpc/rawtransaction.cpp
+
+ for (unsigned int idx = 0; idx < txs.size(); idx++) {
+ if (!DecodeHexTx(txVariants[idx], txs[idx].get_str(), true))
+ throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed for tx " + idx);
@morcos

morcos Jul 17, 2017

Contributor

nit: braces

src/rpc/rawtransaction.cpp
+ }
+
+ if (txVariants.empty())
+ throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Missing transactions");
@morcos

morcos Jul 17, 2017

Contributor

nit: braces

test/functional/rawtransactions.py
+ self.sync_all()
+
+ #THIS IS A INCOMPLETE FEATURE
+ #NODE2 HAS TWO OF THREE KEY AND THE FUNDS SHOULD BE SPENDABLE AND COUNT AT BALANCE CALCULATION
@morcos

morcos Jul 17, 2017

Contributor

This is copy-paste error leading to incorrect documentation of the test. This test is a 2of2 multisig for which node 2 has only 1 key.

Contributor

achow101 commented Jul 17, 2017

Nits addressed and rebased.

Contributor

morcos commented Jul 17, 2017

@achow101 It's better if you address the nits separately from rebasing (was rebasing needed?) otherwise its hard to review just the differential and reACK.

test/functional/rawtransactions.py
+ self.sync_all()
+
+ #THIS IS A INCOMPLETE FEATURE
+ #NODE2 HAS ONE OF TWO KEY AND THE FUNDS SHOULD BE SPENDABLE AND COUNT AT BALANCE CALCULATION
@morcos

morcos Jul 17, 2017

Contributor

This comment is still incorrect. The funds should not be spendable there is nothing incomplete here.

Contributor

achow101 commented Jul 17, 2017

@morcos sorry, I rebased out of habit.

Contributor

achow101 commented Jul 17, 2017

Now the comment should be right.

Contributor

morcos commented Jul 17, 2017

heh thanks...
and i think its ok to squash, especially if the old commit can still be found, b/c then a diff btwn old and new can show the differences. it's the rebase that makes it difficult

utACK f293282

Contributor

morcos commented Jul 17, 2017

utACK 3cd7a5b

Owner

sipa commented Jul 17, 2017

utACK 3cd7a5b

src/rpc/rawtransaction.cpp
+
+ for (unsigned int idx = 0; idx < txs.size(); idx++) {
+ if (!DecodeHexTx(txVariants[idx], txs[idx].get_str(), true)) {
+ throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed for tx " + idx);
@laanwj

laanwj Jul 18, 2017 edited

Owner

This won't work, you're adding a string and an integer. Use strprintf?

@achow101

achow101 Jul 18, 2017

Contributor

Fixed

@achow101 achow101 Move transaction combining from signrawtransaction to new RPC
Create a combinerawtransaction RPC which accepts a json array of hex raw
transactions to combine them into one transaction. Signrawtransaction is changed
to no longer combine transactions and only accept one transaction at a time.
6b4f231

@laanwj laanwj merged commit 6b4f231 into bitcoin:master Jul 20, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@laanwj laanwj added a commit that referenced this pull request Jul 20, 2017

@laanwj laanwj Merge #10571: [RPC]Move transaction combining from signrawtransaction…
… to new RPC


6b4f231 Move transaction combining from signrawtransaction to new RPC (Andrew Chow)

Pull request description:

  Create a combinerawtransaction RPC which accepts a json array of hex raw transactions to combine them into one transaction. Signrawtransaction is changed to no longer combine transactions and only accept one transaction at a time.

  The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed.

  This is part of #10570

Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
adf170d

TheBlueMatt referenced this pull request Jul 23, 2017

Open

TODO for release notes 0.15.0 #9889

0 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment