aboutsummaryrefslogtreecommitdiff
path: root/src/psbt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* psbt: always put a non_witness_utxo and don't remove itAndrew Chow2020-06-241-3/+4
| | | | | Offline signers will always need a non_witness_utxo so make sure it is there.
* psbt: Allow both non_witness_utxo and witness_utxoAndrew Chow2020-06-241-29/+0
|
* [gui] PSBT Operations Dialog (sign & broadcast)Glenn Willen2020-06-191-0/+11
| | | | | | | Add a "PSBT Operations" dialog, reached from the "Load PSBT..." menu item, giving options to sign or broadcast the loaded PSBT as appropriate, as well as copying the result to the clipboard or saving it to a file.
* scripted-diff: Bump copyright headersMarcoFalke2020-04-161-1/+1
| | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* Merge #17156: psbt: check that various indexes and amounts are within boundsfanquake2020-01-291-1/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deaa6dd144f5650b385658a0c4f9a014aff8dde2 psbt: check output index is within bounds before accessing (Andrew Chow) f1ef7f0aa46338f4cd8de79696027a1bf868f359 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Fixes #17149 Two classes of issues were found by the psbt fuzzer: values out of range and causing overflows, and prevout indexes being out of range. This PR fixes both. When accessing a specific output using the index given in the tx, check that it is actually a possible output before trying to access the output. When summing and checking amounts for `decodepsbt` and `analyzepsbt`, make sure that the values are actually valid money values.. Otherwise, stop summing and don't show the fee. For `analyzepsbt`, return that the next role is the Creator since the Creator needs to remake the transaction to be valid. ACKs for top commit: practicalswift: ACK deaa6dd144f5650b385658a0c4f9a014aff8dde2 -- only change since last ACK was the addition of tests gwillen: tested ACK deaa6dd, would also like to see this merged! Tree-SHA512: 06c36720bbb5a7ab1c29f7d15878bf9f0d3e5760c06bff479d412e1bf07bb3e0e9ab6cca820a4bfedaab71bfd7af813807e87cbcdf0af25cc3f66a53a06dbcfd
| * psbt: check output index is within bounds before accessingAndrew Chow2020-01-061-1/+7
| |
* | scripted-diff: Bump copyright of files changed in 2019MarcoFalke2019-12-301-1/+1
|/ | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* Have a PSBTAnalysis state that indicates invalid PSBTAndrew Chow2019-11-191-0/+1
| | | | | | | | | 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.
* Remove unused includespracticalswift2019-10-151-1/+0
|
* Merge #15427: Add support for descriptors to utxoupdatepsbtWladimir J. van der Laan2019-07-021-0/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 26fe9b990995f9cb5eee21d40b4daaad19f7181f Add support for descriptors to utxoupdatepsbt (Pieter Wuille) 3135c1a2d2e2fb31bc362c848bd2456d576e408b Abstract out UpdatePSBTOutput from FillPSBT (Pieter Wuille) fb90ec3c33e824f5abb6a68452c683d6ce8b3e4a Abstract out EvalDescriptorStringOrObject from scantxoutset (Pieter Wuille) eaf4f887348a08c620732125ad4430e1a133d434 Abstract out IsSegWitOutput from utxoupdatepsbt (Pieter Wuille) Pull request description: This adds a descriptors argument to the `utxoupdatepsbt` RPC. This means: * Input and output scripts and keys will be filled in when known. * P2SH-witness inputs will be filled in from the UTXO set when a descriptor is provided that shows they're spending segwit outputs. This also moves some (newly) shared code to separate functions: `UpdatePSBTOutput` (an analogue to `SignPSBTInput`), `IsSegWitOutput`, and `EvalDescriptorStringOrObject` (implementing the string or object notation parsing used in `scantxoutset`). ACKs for top commit: jnewbery: utACK 26fe9b990995f9cb5eee21d40b4daaad19f7181f laanwj: utACK 26fe9b990995f9cb5eee21d40b4daaad19f7181f (will hold merging until response to promag's comments) promag: ACK 26fe9b9, checked refactors and tests look comprehensive. Still missing a release note but can be added later. Tree-SHA512: 1d833b7351b59d6c5ded6da399ff371a8a2a6ad04c0a8f90e6e46105dc737fa6f2740b1e5340280d59e01f42896c40b720c042f44417e38dfbee6477b894b245
| * Abstract out UpdatePSBTOutput from FillPSBTPieter Wuille2019-05-101-0/+19
| |
* | Make reasoning about dependencies easier by not including unused dependenciespracticalswift2019-06-021-3/+0
|/
* Silence GCC 7 warning "control reaches end of non-void function" ↵practicalswift2019-05-021-0/+2
| | | | (-Wreturn-type) in psbt.cpp
* [build] Move AnalyzePSBT from psbt.cpp to node/psbt.cppRussell Yanofsky2019-04-091-123/+0
| | | | | | | | | | | | 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.
* Refactor analyzepsbt for use outside RPC codeGlenn Willen2019-03-261-1/+138
| | | | | | Refactor the analyzepsbt RPC into (1) an AnalyzePSBT function, which returns its output as a new strongly-typed PSBTAnalysis struct, and (2) a thin wrapper which converts the struct into a UniValue for RPC use.
* Move PSBT decoding functions from core_io to psbt.cppGlenn Willen2019-03-261-0/+27
| | | | | Move PSBT decoding functions from core_io.h/core_read.cpp to psbt.h/psbt.cpp, to deal with a linker issue.
* Merge #15408: Remove unused TransactionError constantsMarcoFalke2019-02-221-6/+4
|\ | | | | | | | | | | | | | | | | | | | | | | fa9b60c842 Remove unused TransactionError constants (MarcoFalke) Pull request description: Fixup to #14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case. Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future). Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
| * Remove unused TransactionError constantsMarcoFalke2019-02-141-6/+4
| |
* | Move PSBT UTXO fetching to a separate methodAndrew Chow2019-02-161-0/+14
| |
* | Figure out what is missing during signingAndrew Chow2019-02-161-4/+16
| | | | | | | | | | | | | | When signing an input, figure out what was requested for but was unable to be found and store it in a SignatureData. Return this information in SignPSBTInput.
* | Implement joinpsbts RPC and testsAndrew Chow2019-02-161-0/+20
|/ | | | | Adds a joinpsbts RPC which combines multiple distinct PSBTs into one PSBT.
* Factor out combine / finalize / extract PSBT helpersGlenn Willen2019-02-111-0/+49
| | | | | | Refactor the new CombinePSBT, FinalizePSBT, and FinalizeAndExtractPSBT general-purpose functions out of the combinepsbt and finalizepsbt RPCs, for use in the GUI code.
* Remove op== on PSBTs; check compatibility in MergeGlenn Willen2019-02-111-1/+8
| | | | | | Remove the op== on PartiallySignedTransaction, which only checks that the CTransactions are equal. Instead, check this directly in Merge, and return false if the CTransactions are not equal (so the PSBTs cannot be merged.)
* Move PSBT definitions and code to separate filesGlenn Willen2019-02-111-0/+227
Move non-wallet PSBT code to src/psbt.{h,cpp}, and PSBT wallet code to src/wallet/psbtwallet.{h,cpp}. This commit contains only code movement (and adjustments to includes and Makefile.am.)