Skip to content

Conversation

achow101
Copy link
Member

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

@sipa
Copy link
Member

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?

@jnewbery
Copy link
Contributor

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

@sipa
Copy link
Member

sipa commented Jun 28, 2017

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

@laanwj laanwj added this to the 0.15.0 milestone Jul 6, 2017
@achow101 achow101 force-pushed the combineraw-rpc branch 2 times, most recently from aeebcd0 to c710eb9 Compare July 7, 2017 23:37
@sipa
Copy link
Member

sipa commented Jul 15, 2017

utACK c710eb9eaffa50daddfedb50a93036085b3296c7

Copy link
Contributor

@gmaxwell gmaxwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

Copy link
Contributor

@morcos morcos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK c710eb9

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


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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: braces

}

if (txVariants.empty())
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Missing transactions");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: braces

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@achow101
Copy link
Member Author

Nits addressed and rebased.

@morcos
Copy link
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.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@achow101
Copy link
Member Author

@morcos sorry, I rebased out of habit.

@achow101
Copy link
Member Author

Now the comment should be right.

@morcos
Copy link
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

@morcos
Copy link
Contributor

morcos commented Jul 17, 2017

utACK 3cd7a5b

@sipa
Copy link
Member

sipa commented Jul 17, 2017

utACK 3cd7a5bc31e1a3cdd1cc740a884f69d9c6689e2f


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);
Copy link
Member

@laanwj laanwj Jul 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

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.
@laanwj laanwj merged commit 6b4f231 into bitcoin:master Jul 20, 2017
laanwj added a commit that referenced this pull request Jul 20, 2017
… 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
@TheBlueMatt TheBlueMatt mentioned this pull request Jul 23, 2017
12 tasks
@achow101 achow101 deleted the combineraw-rpc branch August 29, 2017 15:28
sipa added a commit that referenced this pull request Feb 20, 2018
…et RPC command

d602348 Add test for signrawtransaction (Andrew Chow)
eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow)
1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow)

Pull request description:

  This PR is part of #10570. It also builds on top of #10571.

  This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys.

  The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior.

  All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff.

Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 16, 2019
…saction 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 bitcoin#10570

Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed

Conflicts:
	src/rpc/client.cpp
	src/rpc/rawtransaction.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 18, 2019
…saction 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 bitcoin#10570

Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed

Conflicts:
	src/rpc/client.cpp
	src/rpc/rawtransaction.cpp
codablock pushed a commit to codablock/dash that referenced this pull request Sep 20, 2019
…saction 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 bitcoin#10570

Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
UdjinM6 added a commit to UdjinM6/dash that referenced this pull request Sep 20, 2019
…nrawtransaction to new RPC"

This reverts commit 6478562.
UdjinM6 added a commit to UdjinM6/dash that referenced this pull request Sep 20, 2019
…nrawtransaction to new RPC"

This reverts commit 6478562.
codablock pushed a commit to codablock/dash that referenced this pull request Sep 22, 2019
…saction 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 bitcoin#10570

Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
codablock pushed a commit to codablock/dash that referenced this pull request Sep 23, 2019
…saction 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 bitcoin#10570

Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
barrystyle pushed a commit to PACGlobalOfficial/PAC that referenced this pull request Jan 22, 2020
…saction 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 bitcoin#10570

Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 11, 2020
…on-wallet RPC command

d602348 Add test for signrawtransaction (Andrew Chow)
eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow)
1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow)

Pull request description:

  This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571.

  This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys.

  The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior.

  All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff.

Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 12, 2020
…on-wallet RPC command

d602348 Add test for signrawtransaction (Andrew Chow)
eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow)
1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow)

Pull request description:

  This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571.

  This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys.

  The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior.

  All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff.

Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 12, 2020
…on-wallet RPC command

d602348 Add test for signrawtransaction (Andrew Chow)
eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow)
1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow)

Pull request description:

  This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571.

  This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys.

  The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior.

  All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff.

Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 15, 2020
…on-wallet RPC command

d602348 Add test for signrawtransaction (Andrew Chow)
eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow)
1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow)

Pull request description:

  This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571.

  This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys.

  The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior.

  All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff.

Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 15, 2020
…on-wallet RPC command

d602348 Add test for signrawtransaction (Andrew Chow)
eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow)
1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow)

Pull request description:

  This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571.

  This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys.

  The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior.

  All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff.

Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 18, 2020
…on-wallet RPC command

d602348 Add test for signrawtransaction (Andrew Chow)
eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow)
1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow)

Pull request description:

  This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571.

  This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys.

  The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior.

  All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff.

Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants