aboutsummaryrefslogtreecommitdiff
path: root/src/psbt.h
AgeCommit message (Collapse)Author
2019-11-20Merge #12461: scripted-diff: Rename key size consts to be relative to their ↵Wladimir J. van der Laan
class 0580f86bb48004b797d4cb6273e7ffee0b0a0584 Fixup whitespace (Ben Woosley) 47101bbb27d0e13ea2b40ce1c7ff0dba9030f369 scripted-diff: Rename CPubKey and CKey::*_KEY_SIZE and COMPRESSED_*_KEY_SIZE (Ben Woosley) Pull request description: ~~And introduce CPubKeySig to host code relative to key sigs.~~ ACKs for top commit: meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/12461/commits/0580f86bb48004b797d4cb6273e7ffee0b0a0584 Tree-SHA512: 29aa0be54912358b138e391b9db78639786f56580493e590ec9f773c0e1b421740133d05a79be247c7ee57e71c9c9e41b9cb54088cb3c0e3f813f74f0895287b
2019-11-01refactor: Remove redundant PSBT copy constructorHennadii Stepanov
The default (i.e., generated by a compiler) copy constructor does the same things. Also this prevents -Wdeprecated-copy warning for implicitly declared operator= in GCC 9.
2019-10-30refactor: Replace all uses of boost::optional with our own Optional typeWladimir J. van der Laan
After this: - `boost::optional` is no longer used directly (only through `Optional` which is an alias for it) - `boost/optional.hpp` is only included in one place
2019-10-08Fix bug where duplicate PSBT keys are acceptedJohn L. Jegutanis
As per the BIP 174 spec a PSBT key cannot be duplicated, however the current code accepts key duplication. The PSBT key/value entries can be duplicated when the value is `empty()` or `IsNull()` for `CScript` or `CTxOut` respectively and if those key/value entries are serialized before the non-empty ones. For example, the following PSBT, included in the test vectors, contains a duplicate field: ``` // magic 70736274ff // global tx //// key 0100 //// value 2a02000000000140420f000000000017a9146e91b72d5593e7d4391e2ff44e91e985c31641f08700000000 //// separator 00 // no inputs // outputs //// key PSBT_OUT_WITNESSSCRIPT 0101 //// value (empty script) 00 //// key PSBT_OUT_WITNESSSCRIPT (same as the above) 0101 //// value (an OP_RETURN script) 016a //// separator 00 ```
2019-07-09Move various SigningProviders to signingprovider.{cpp,h}Andrew Chow
Moves all of the various SigningProviders out of sign.{cpp,h} and keystore.{cpp,h}. As such, keystore.{cpp,h} is also removed. Includes and the Makefile are updated to reflect this. Includes were largely changed using: git grep -l "keystore.h" | xargs sed -i -e 's;keystore.h;script/signingprovider.h;g'
2019-05-10Abstract out UpdatePSBTOutput from FillPSBTPieter Wuille
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-03-26Add documentation of struct PSBTAnalysis et alGlenn Willen
2019-03-26Refactor analyzepsbt for use outside RPC codeGlenn Willen
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.
2019-03-26Move PSBT decoding functions from core_io to psbt.cppGlenn Willen
Move PSBT decoding functions from core_io.h/core_read.cpp to psbt.h/psbt.cpp, to deal with a linker issue.
2019-03-04scripted-diff: Rename CPubKey and CKey::*_KEY_SIZE and COMPRESSED_*_KEY_SIZEBen Woosley
To SIZE and COMPRESSED_SIZE -BEGIN VERIFY SCRIPT- sed -i 's/PRIVATE_KEY_SIZE/SIZE/g' src/*.h src/*.cpp src/**/*.h src/**/*.cpp sed -i 's/COMPRESSED_PRIVATE_KEY_SIZE/COMPRESSED_SIZE/g' src/*.h src/**/*.cpp src/**/*.h src/**/*.cpp sed -i 's/PUBLIC_KEY_SIZE/SIZE/g' src/*.h src/*.cpp src/**/*.h src/**/*.cpp sed -i 's/COMPRESSED_PUBLIC_KEY_SIZE/COMPRESSED_SIZE/g' src/*.h src/*.cpp src/**/*.h src/**/*.cpp -END VERIFY SCRIPT-
2019-02-22Merge #15408: Remove unused TransactionError constantsMarcoFalke
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
2019-02-16Move PSBT UTXO fetching to a separate methodAndrew Chow
2019-02-16Figure out what is missing during signingAndrew Chow
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.
2019-02-16Implement joinpsbts RPC and testsAndrew Chow
Adds a joinpsbts RPC which combines multiple distinct PSBTs into one PSBT.
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-11Remove op== on PSBTs; check compatibility in MergeGlenn Willen
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.)
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-11Move PSBT definitions and code to separate filesGlenn Willen
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.)