mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-11 16:17:54 +02:00
More concise conversion of CDataStream to string
Use .str() instead of .data() and .size() when converting CDataStream to a string. Uses std::string, avoiding conversion to a C string.
This commit is contained in:
@@ -3842,7 +3842,7 @@ UniValue walletprocesspsbt(const JSONRPCRequest& request)
|
||||
UniValue result(UniValue::VOBJ);
|
||||
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
|
||||
ssTx << psbtx;
|
||||
result.pushKV("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size()));
|
||||
result.pushKV("psbt", EncodeBase64(ssTx.str()));
|
||||
result.pushKV("complete", complete);
|
||||
|
||||
return result;
|
||||
@@ -3956,7 +3956,7 @@ UniValue walletcreatefundedpsbt(const JSONRPCRequest& request)
|
||||
ssTx << psbtx;
|
||||
|
||||
UniValue result(UniValue::VOBJ);
|
||||
result.pushKV("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size()));
|
||||
result.pushKV("psbt", EncodeBase64(ssTx.str()));
|
||||
result.pushKV("fee", ValueFromAmount(fee));
|
||||
result.pushKV("changepos", change_position);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user