Commit graph

160 commits

Author SHA1 Message Date
Patrick Lodder edd0da7968
scripted-diff: Use UniValue.pushKV instead of push_back(Pair())
-BEGIN VERIFY SCRIPT-
git grep -l "push_back(Pair" | xargs sed -i "s/push_back(Pair(\(.*\)));/pushKV(\1);/g"
-END VERIFY SCRIPT-

Copied from: bitcoin/bitcoin#91986ed2
2021-10-18 03:50:47 +02:00
Patrick Lodder fd6da81954
wallet: introduce -discardthreshold
Creates a wallet-specific, configurable dust limit that enables
gradual implementation of the dust limit. Each transaction created
with the wallet will adhere to this threshold rather than the dust
limits used for relay, so that the wallet stays usable while the
network changes (lowers) its dust limits.

This change only implements the parameter but does not change its
default value.
2021-10-10 22:07:00 +02:00
Michi Lumin 1d2380df56 p2p: Reduce BIP125 replace by fee increment value 2021-08-04 09:29:35 +01:00
Pedro Branco 3c1fa13921 Add query options to listunspent rpc call 2021-02-22 22:23:09 +01:00
Ikko Ashimine 3ba037d793
[wallet] fix typo in rpcwallet.cpp
replacable -> replaceable
2021-02-06 12:05:47 +09:00
Ross Nicoll 148a2aca05 Introduce basic Dogecoin branding 2019-03-25 05:36:11 +00:00
Ross Nicoll 18850d359b Add Dogecoin current fee calculation logic (#1413)
Introduces 1 COIN/kb fees, rounded up to the next 1 COIN.
2018-09-19 21:09:16 +01:00
Ross Nicoll 1be681a1b9 Modify chain consensus parameters to be height aware (#1396)
* Modify chain consensus parameters to be height aware
* Correct implementation of simplified rewards in parameters
* Correct max money
* Use base block version in IsSuperMajority() instead of full version
* Correct mining of blocks in AuxPoW tests
* Add in missing pre-AuxPoW consensus checks
2018-09-19 19:24:06 +01:00
John Newbery f5efe82a83 Return correct error codes in fundrawtransaction().
The fundrawtransaction() RPC was returning misleading or incorrect error
codes (for example RPC_INTERNAL_ERROR when funding the transaction
failed). This commit fixes those error codes:

- RPC_INTERNAL_ERROR should not be returned for application-level
errors, only for genuine internal errors such as corrupted data.

That error code has been replaced with RPC_WALLET_ERROR.

This commit also updates the test cases to explicitly test the error code.

Github-Pull: #9853
Rebased-From: dab804c18a
2017-06-05 19:01:16 +00:00
John Newbery 3ad00b4b32 Return correct error codes in bumpfee().
The bumpfee() RPC was returning misleading or incorrect error codes
(for example RPC_INVALID_ADDRESS_OR_KEY when the transaction was not
BIP125 replacable). This commit fixes those error codes:

- RPC_INVALID_ADDRESS_OR_KEY if an invalid address was provided:
    - Invalid change address given
- RPC_INVALID_PARAMETER if a single (non-address/key) parameter is incorrect
    - confTarget and totalFee options should not both be set.
    - Invalid confTarget
    - Insufficient totalFee (cannot be less than required fee)
- RPC_WALLET_ERROR for any other error
    - Transaction has descendants in the wallet
    - Transaction has descendants in the mempool
    - Transaction has been mined, or is conflicted with a mined transaction
    - Transaction is not BIP 125 replaceable
    - Transaction has already been bumped
    - Transaction contains inputs that don't belong to the wallet
    - Transaction has multiple change outputs
    - Transaction does not have a change output
    - Fee is higher than maxTxFee
    - New fee rate is less than the minimum fee rate
    - Change output is too small.

This commit also updates the test cases to explicitly test the error code.

Github-Pull: #9853
Rebased-From: 6d07c62322
2017-06-05 19:01:16 +00:00
Marijn Stollenga 289204fbe0
Change bitcoin address in RPC helpaddress to an invalid address, so people don't accidentally send coins there (like I did).
Github-Pull: #9865
Rebased-From: 83ac719d34
2017-02-28 12:01:06 +01:00
Russell Yanofsky 08e0690f3f
Update sendfrom RPC help to correct coin selection misconception
Github-Pull: #9840
Rebased-From: f81f0d0030
2017-02-28 11:41:58 +01:00
Russell Yanofsky 4ec057dfa7 [wallet] Set correct metadata on bumpfee wallet transactions
Preserve comment, order form, and account strings from the original wallet
transaction. Also set fTimeReceivedIsTxTime and fFromMe fields for consistency
with CWallet::CreateTransaction. The latter two fields don't influence current
wallet behavior, but do record that the transaction originated in the wallet
instead of coming from the network or sendrawtransaction.
2017-02-02 17:34:22 -05:00
Wladimir J. van der Laan e30d9287fd
Merge #9663: [RPC] clarify listunspent amount description
3eba88d clarify listunspent amount description (Gregory Sanders)
2017-02-02 10:13:21 +01:00
Gregory Sanders 3eba88d44c clarify listunspent amount description 2017-02-01 12:18:31 -05:00
Suhas Daftuar 9522b53a91 rpc: bumpfee: handle errors more gracefully 2017-01-31 20:03:45 -05:00
Suhas Daftuar f62659448c rpc: bumpfee: use correct maximum signed tx size for fee calculation
More accurate than simply adding one byte per input, and properly handles the
case where the original transaction happened to have very small signatures
2017-01-31 20:03:45 -05:00
Wladimir J. van der Laan d2c9e4d422
Merge #9615: Wallet incremental fee
4b189c1 Change bumpfee result value from 'oldfee' to 'origfee'. (Alex Morcos)
0c0c63f Introduce WALLET_INCREMENTAL_RELAY_FEE (Alex Morcos)
e8021ec Use CWallet::GetMinimumFee in bumpfee (Alex Morcos)
ae9719a Refactor GetMinimumFee to give option of providing targetFee (Alex Morcos)
fe8e8ef [rpc] Add incremental relay fee to getnetworkinfo (Alex Morcos)
6b331e6 Fix to have miner test aware of new separate block min tx fee (Alex Morcos)
de6400d Fix missing use of dustRelayFee (Alex Morcos)
5b15870 Use incrementalRelayFee for BIP 125 replacement (Alex Morcos)
2017-01-30 10:38:56 +01:00
Alex Morcos 4b189c1340 Change bumpfee result value from 'oldfee' to 'origfee'.
The result value indicates the actual fee on the transaction that was replaced. But there is an error message which uses the description 'oldfee' to refer to the original fee rate applied to the new transaction's estimated max size.  It was confusing that two different uses of 'oldfee' had two different numeric values.
2017-01-26 12:03:47 -05:00
Alex Morcos 0c0c63f70a Introduce WALLET_INCREMENTAL_RELAY_FEE
Have wallet's default bump value be higher than the default incrementalRelayFee to future proof against changes to incremental relay fee.  Only applies when not setting the fee rate directly.
2017-01-26 12:03:47 -05:00
Alex Morcos e8021ec919 Use CWallet::GetMinimumFee in bumpfee
Use the wallet's fee calculation logic to properly clamp fee against minimums and maximums when calculating the fee for a bumpfee transaction.  Unless totalFee is explictly given, in which case, manually check against min, but do nothing to adjust given fee.

In all cases do a final check against maxTxFee (after adding any incremental amount).
2017-01-26 09:43:00 -05:00
Wladimir J. van der Laan 07421cf2a7
Merge #9613: [wallet] Clarify getbalance help string to explain interaction with bumpfee
5a00659 [wallet] Clarify getbalance help string to explain interaction with bumpfee (Russell Yanofsky)
2017-01-26 10:14:13 +01:00
Wladimir J. van der Laan 727a798360
Merge #9516: Bug-fix: listsinceblock: use fork point as reference for blocks in reorg'd chains
7ba0a00 Testing: listsinceblock should not use orphan block height. (Karl-Johan Alm)
ee5c1ce Bug-fix: listsinceblock: use closest common ancestor when a block hash was provided for a chain that was not the main chain. (Karl-Johan Alm)
2017-01-23 16:16:37 +01:00
Russell Yanofsky 5a00659b58 [wallet] Clarify getbalance help string to explain interaction with bumpfee
Documentation change only, no change in behavior.
2017-01-23 09:54:11 -05:00
Wladimir J. van der Laan fb75cd04bb
Merge #9377: fundrawtransaction: Keep change-output keys by default, make it optional
c9f3062 Add fundrawtransactions new reserveChangeKey option to the release notes (Jonas Schnelli)
9eb325d [QA] Add test for fundrawtransactions new reserveChangeKey option (Jonas Schnelli)
9aa4e6a [Wallet] Add an option to keep the change address key, true by default (Jonas Schnelli)
2017-01-20 14:32:42 +01:00
Alex Morcos fe8e8efcf9 [rpc] Add incremental relay fee to getnetworkinfo 2017-01-20 07:40:36 -05:00
Alex Morcos de6400de5d Fix missing use of dustRelayFee 2017-01-19 20:31:29 -05:00
Alex Morcos 5b158707f2 Use incrementalRelayFee for BIP 125 replacement 2017-01-19 20:31:29 -05:00
Jonas Schnelli 9aa4e6a6c2
[Wallet] Add an option to keep the change address key, true by default 2017-01-19 20:38:37 +01:00
Wladimir J. van der Laan 2ef52d3cf1
Merge #8456: [RPC] Simplified bumpfee command.
cc0243a [RPC] bumpfee (mrbandrews)
52dde66 [wallet] Add include_unsafe argument to listunspent RPC (Russell Yanofsky)
766e8a4 [wallet] Add IsAllFromMe: true if all inputs are from wallet (Suhas Daftuar)
2017-01-19 19:59:24 +01:00
mrbandrews cc0243ad32 [RPC] bumpfee
This command allows a user to increase the fee on a wallet transaction T, creating a "bumper" transaction B.
T must signal that it is BIP-125 replaceable.
T's change output is decremented to pay the additional fee.  (B will not add inputs to T.)
T cannot have any descendant transactions.
Once B bumps T, neither T nor B's outputs can be spent until either T or (more likely) B is mined.

Includes code by @jonasschnelli and @ryanofsky
2017-01-19 11:29:29 -05:00
Russell Yanofsky 52dde66770 [wallet] Add include_unsafe argument to listunspent RPC 2017-01-19 11:29:29 -05:00
Karl-Johan Alm ee5c1ce5a6 Bug-fix: listsinceblock: use closest common ancestor when a block hash was provided for a chain that was not the main chain. 2017-01-18 12:07:13 +09:00
Wladimir J. van der Laan 7cb024eba6
Merge #9222: Add 'subtractFeeFromAmount' option to 'fundrawtransaction'.
453bda6 Add 'subtractFeeFromOutputs' option to 'fundrawtransaction'. (Chris Moore)
2017-01-12 12:49:10 +01:00
Michael Rotarius 54ee3fcb8f RPC help updated 2017-01-11 22:05:23 +01:00
John Newbery 4e7e2e16e4 Update RPC argument names 2017-01-10 12:04:54 +01:00
Wladimir J. van der Laan 9adb4e1a59 rpc: Argument name consistency
The meaning is clear from the context, and we're inconsistent here.
Also save typing when using named arguments.

- `bitcoinaddress` -> `address`
- `bitcoinprivkey` -> `privkey`
- `bitcoinpubkey` -> `pubkey`
2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan 37a166f146 rpc: Named arguments for wallet calls 2017-01-05 11:30:20 +01:00
Pieter Wuille ce370c1811 Mark the minconf parameter to move as ignored 2017-01-04 08:48:21 -08:00
accraze 3f67972654 updated listsinceblock rpc docs
fixes #8758
2016-12-22 09:28:03 -08:00
Chris Moore 453bda63dd Add 'subtractFeeFromOutputs' option to 'fundrawtransaction'. 2016-12-13 13:36:23 -08:00
Gregory Sanders bc7ff8db99 Add option to return non-segwit serialization via rpc 2016-12-05 07:43:22 -05:00
Wladimir J. van der Laan c01f16aaa0
Merge #9165: SendMoney: use already-calculated balance
ea83d00 SendMoney: use already-calculated balance (instagibbs)
2016-12-05 12:47:31 +01:00
Pieter Wuille 42fd8dee30 Make DecodeHexTx return a CMutableTransaction 2016-12-02 18:28:22 -08:00
Pieter Wuille c3f5673a63 Make CWalletTx store a CTransactionRef instead of inheriting 2016-12-02 18:28:22 -08:00
Matt Corallo 76faa3cdfe Rename the remaining main.{h,cpp} to validation.{h,cpp} 2016-12-02 09:42:51 -08:00
instagibbs ea83d0098a SendMoney: use already-calculated balance 2016-11-15 11:56:45 -05:00
matthias 7f61b49de8 Change all instance of 'GMT epoch' to 'Unix epoch' 2016-10-31 01:11:46 +01:00
Wladimir J. van der Laan 0dcb888266
Merge #9016: Return useful error message on ATMP failure
169bdab Return useful error message on ATMP failure (instagibbs)
2016-10-28 13:49:15 +02:00
instagibbs 169bdabe14 Return useful error message on ATMP failure 2016-10-26 15:59:33 -04:00