Basic implementation of a new rpc call fundrawtransaction
.
This call will fill a rawtransaction containing only vouts with unspent coins from the wallet.
Currently there is no way to return the CReserveKey
to the keypool.
Basic implementation of a new rpc call fundrawtransaction
.
This call will fill a rawtransaction containing only vouts with unspent coins from the wallet.
Currently there is no way to return the CReserveKey
to the keypool.
createrawtransactions
with potential unspent vins, this call does not lock the coins somehow.
792+ CTransaction tx;
793+ if (!DecodeHexTx(tx, params[0].get_str()))
794+ throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
795+
796+ if (tx.vin.size() > 0)
797+ throw JSONRPCError(RPC_INVALID_PARAMETER, "fundrawtransaction only supports transactions with zero exiting vins");
Also, not to pile on too much, but a “fundmany” would be neat as well (in addition to watchonly support in fundrawtransaction). This would be useful for batch coin selection, offline signing, and coinjoin. Plus, fundmany is not a huge jump from sendmany.
Also, gmaxwell proposed on IRC a limit=N parameter on fundrawtransaction?
limit
parameter needs probably some brainwork first. See (http://bitcoinstats.com/irc/bitcoin-dev/logs/2014/12/20#l1419085131). Maybe another pull.
CreateTransaction
which produced endless recursive loops. Travis should now be happy.
1372+ if (!out.fSpendable)
1373+ continue;
1374+
1375+ nValueTroughVINs += out.tx->vout[out.i].nValue;
1376+
1377+ // temporary keep the coin to add them later after SelectCoinsMinConf has added some
320@@ -321,7 +321,9 @@ static const CRPCCommand vRPCCommands[] =
321 { "rawtransactions", "getrawtransaction", &getrawtransaction, true, false },
322 { "rawtransactions", "sendrawtransaction", &sendrawtransaction, false, false },
323 { "rawtransactions", "signrawtransaction", &signrawtransaction, false, false }, /* uses wallet if enabled */
324-
325+#ifdef ENABLE_WALLET
326+ { "rawtransactions", "fundrawtransaction", &fundrawtransaction, false, false },
1892@@ -1823,6 +1893,14 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend,
1893 strFailReason = _("Transaction too large");
1894 return false;
1895 }
1896+
1897+ //remove signature if we used the signing only for the fee calculation
Updated!
fundrawtransaction
now works with locked wallets. Fee / priority calculation now goes over a new dummy-signing way in sign.cpp
.
RPC tests are now even more extensive and includes multisig test, locked wallet tests as well as comparison of calculated fee and correct fee tests.
The only question is, if it would be worth to add a optional correctFee=1|0
argument for the fundrawtransaction
rpc call. With settings this flag, users could enforce correct signing of the tx (would require unlocked wallet) which would end up in getting a more precise/correct fee.
rebased.
Moved RPC function “fundrawtransaction()” from rpcrawtransaction.cpp
to rpcwallet.cpp
(fundrawtransaction is a wallet function). Added wallet-is-presence check because we recently removed “reqWallet” check over the RPC dispatch table.
- fix typo
- fix RPCTypeCheck for fundrawtransaction
- some comments
- merged with subtractFeeFromAmout patch (non trivial)
- serialize transaction size calculation (aka dummy-signing) without the need of signing the transaction (wallet can be locked to use fundrawtransaction)
- rename VINS to vInputs
fundrawtransaction requires a wallet and therefore it belongs to rpcwallet.cpp
rpc dispatch tables reqWallet has been removed.
# Conflicts:
# src/rpcserver.cpp
# Conflicts:
# src/wallet/rpcwallet.cpp
jonasschnelli
aalness
gmaxwell
kanzure
fanquake
laanwj
jgarzik
TheBlueMatt
Labels
Wallet
RPC/REST/ZMQ
Milestone
0.11.0