mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
PSBT for Confidential Assets
This commit is contained in:
parent
f87684a007
commit
2848b520b2
20 changed files with 1166 additions and 227 deletions
|
|
@ -177,33 +177,6 @@ bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DecodeBase64PSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error)
|
||||
{
|
||||
bool invalid;
|
||||
std::string tx_data = DecodeBase64(base64_tx, &invalid);
|
||||
if (invalid) {
|
||||
error = "invalid base64";
|
||||
return false;
|
||||
}
|
||||
return DecodeRawPSBT(psbt, tx_data, error);
|
||||
}
|
||||
|
||||
bool DecodeRawPSBT(PartiallySignedTransaction& psbt, const std::string& tx_data, std::string& error)
|
||||
{
|
||||
CDataStream ss_data(tx_data.data(), tx_data.data() + tx_data.size(), SER_NETWORK, PROTOCOL_VERSION);
|
||||
try {
|
||||
ss_data >> psbt;
|
||||
if (!ss_data.empty()) {
|
||||
error = "extra data after PSBT";
|
||||
return false;
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
error = e.what();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ParseHashStr(const std::string& strHex, uint256& result)
|
||||
{
|
||||
if ((strHex.size() != 64) || !IsHex(strHex))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue