Switch away from exceptions in refactored tx code

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.
This commit is contained in:
Glenn Willen
2019-02-09 20:51:33 -08:00
parent c6c3d42a7d
commit bd0dbe8763
10 changed files with 159 additions and 24 deletions

View File

@@ -61,7 +61,9 @@ BOOST_AUTO_TEST_CASE(psbt_updater_test)
ssData >> psbtx;
// Fill transaction with our data
FillPSBT(&m_wallet, psbtx, SIGHASH_ALL, false, true);
TransactionError err;
bool complete = true;
FillPSBT(&m_wallet, psbtx, err, complete, SIGHASH_ALL, false, true);
// Get the final tx
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);