aboutsummaryrefslogtreecommitdiff
path: root/src/node
AgeCommit message (Collapse)Author
2020-02-06psbt: check output index is within bounds before accessingAndrew Chow
Github-Pull: #17156 Rebased-From: deaa6dd144f5650b385658a0c4f9a014aff8dde2
2020-02-05Don't calculate tx fees for PSBTs with invalid money valuesAndrew Chow
In decodepsbt if an invalid amount is seen, don't calculate the fee but still show the invalid value in the decode. In analyze psbt, if an invalid amount is seen, set the next step to be the creator as the creator needs to remake the transaction so that it is valid. Github-Pull: #17156 Rebased-From: f1ef7f0aa46338f4cd8de79696027a1bf868f359
2020-01-03Mark PSBTs spending unspendable outputs as invalid in analysisAndrew Chow
Github-Pull: #17524 Rebased-From: 773d4572a4864ab7b6380858d07d9579ff6dd9a2
2020-01-03Have a PSBTAnalysis state that indicates invalid PSBTAndrew Chow
Invalid PSBTs need to be re-created, so the next role is the Creator (new PSBTRole). Additionally, we need to know what went wrong so an error field was added to PSBTAnalysis. A PSBTAnalysis indicating invalid will have empty everything, next will be set to PSBTRole::CREATOR, and an error message. Github-Pull: #17524 Rebased-From: 638e40cb6080800c7b0a7f4028f63326acbe4700
2019-08-27move-only: move coins statistics utils out of RPCJames O'Beirne
These procedures will later be used in the ChainstateManager to compute statistics (particularly a content hash) for UTXO sets coming in from snapshots.
2019-08-15Merge #16443: refactor: have CCoins* data managed under CChainStateMarcoFalke
582d2cd74754d6b9a2394616a9c82a89d2d71976 Cover UTXO set access with lock annotations (James O'Beirne) 569353068568444a25b301bbd6513bb510157dc9 refactor: have CCoins* data managed under CChainState (James O'Beirne) fae6ab6aed3b9fdc9201bb19a307dfc3d9b89891 refactor: pcoinsTip -> CChainState::CoinsTip() (James O'Beirne) Pull request description: This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11): Parent PR: #15606 Issue: #15605 Specification: https://github.com/jamesob/assumeutxo-docs/tree/2019-04-proposal/proposal --- This change encapsulates UTXO set data within CChainState instances, removing global data `pcoinsTip` and `pcoinsviewdb`. This is necessary if we want to maintain multiple chainstates with their own rendering of the UTXO set. We introduce a class CoinsViews which consolidates the construction of a CCoins* hierarchy. This commit could be broken into smaller pieces, but it would require more ephemeral diffs to, e.g., temporarily change CCoinsViewDB's constructor invocations. ACKs for top commit: Sjors: reACK 582d2cd74754d6b9a2394616a9c82a89d2d71976 MarcoFalke: ACK 582d2cd747 Tree-SHA512: ec9d904fe5dca8cd2dc4b7916daa5d8bab30856dd4645987300f905e0a19f9919fce4f9d1ff03eda982943ca73e6e9a746be6cf53b46510de36e8c81a1eafba1
2019-08-08Remove p2pEnabled from Chain interfaceAntoine Riard
RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped.
2019-08-06refactor: pcoinsTip -> CChainState::CoinsTip()James O'Beirne
This aliasing makes subsequent commits easier to review; eventually CoinsTip() will return the CCoinsViewCache managed by CChainState.
2019-08-01Tidy up BroadcastTransaction()John Newbery
2019-08-01Add BroadcastTransaction utility usage in Chain interfaceAntoine Riard
Access through a broadcastTransaction method. Add a wait_callback flag to turn off race protection when wallet already track its tx being in mempool Standardise highfee, absurdfee variable name to max_tx_fee We drop the P2P check in BroadcastTransaction as g_connman is only called by RPCs and the wallet scheduler, both of which are initialized after g_connman is assigned and stopped before g_connman is reset.
2019-07-24refactor : use RelayTransaction in BroadcastTransaction utilityAntoine Riard
To do so, we also refactor RelayTransaction to take a txid instead of passing a tx
2019-04-09[build] Move AnalyzePSBT from psbt.cpp to node/psbt.cppRussell Yanofsky
psbt.cpp definitions except for AnalyzePSBT are used by the wallet and need to be linked into the wallet binary. AnalyzePSBT is an exception in that it is not used by the wallet, and depends on node classes like CCoinsViewCache, and on node global variables like nBytesPerSigOp. So AnalyzePSBT is more at home in libbitcoin_server than libbitcoin_common, and in any case needs to be defined in a separate object file than other PSBT utilities, to avoid dragging link dependencies on node functions and global variables into the wallet.
2019-04-09[docs] Document src subdirectories and different librariesJohn Newbery
2019-04-09[build] Add several util unitsJohn Newbery
Adds the following util units and adds them to libbitcoin_util: - `util/url.cpp` takes `urlDecode` from `httpserver.cpp` - `util/error.cpp` takes `TransactionErrorString` from `node/transaction.cpp` and `AmountHighWarn` and `AmountErrMsg` from `ui_interface.cpp` - `util/fees.cpp` takes `StringForFeeReason` and `FeeModeFromString` from `policy/fees.cpp` - `util/rbf.cpp` takes `SignalsOptInRBF` from `policy/rbf.cpp` - 'util/validation.cpp` takes `FormatStateMessage` and `strMessageMagic` from 'validation.cpp`
2019-03-05Remove use of CCoinsViewMemPool::GetCoin in wallet codeRussell Yanofsky
This commit does not change behavior.
2019-02-14Remove unused TransactionError constantsMarcoFalke
2019-02-11Factor out combine / finalize / extract PSBT helpersGlenn Willen
Refactor the new CombinePSBT, FinalizePSBT, and FinalizeAndExtractPSBT general-purpose functions out of the combinepsbt and finalizepsbt RPCs, for use in the GUI code.
2019-02-11Switch away from exceptions in refactored tx codeGlenn Willen
After refactoring general-purpose PSBT and transaction code out of RPC code, for use in the GUI, it's no longer appropriate to throw exceptions. Instead we now return bools for success, and take an output parameter for an error object. We still use JSONRPCError() for the error objects, since only RPC callers actually care about the error codes.
2019-02-11Factor BroadcastTransaction out of sendrawtransactionGlenn Willen
Factor out a new BroadcastTransaction function, performing the core work of the sendrawtransaction rpc, so that it can be used from the GUI code. Move it from src/rpc/ to src/node/.