Skip to content

Commit 1e0c110

Browse files
committed
Merge 065401b into merged_master (Elements PR #674)
2 parents 799f59c + 065401b commit 1e0c110

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5701,8 +5701,8 @@ UniValue blindrawtransaction(const JSONRPCRequest& request)
57015701
std::vector<std::vector<unsigned char> > auxiliary_generators;
57025702
if (request.params.size() > 2) {
57035703
UniValue assetCommitments = request.params[2].get_array();
5704-
if (assetCommitments.size() != 0 && assetCommitments.size() != tx.vin.size()) {
5705-
throw JSONRPCError(RPC_INVALID_PARAMETER, "Asset commitment array must have exactly as many entries as transaction inputs.");
5704+
if (assetCommitments.size() != 0 && assetCommitments.size() < tx.vin.size()) {
5705+
throw JSONRPCError(RPC_INVALID_PARAMETER, "Asset commitment array must have at least as many entries as transaction inputs.");
57065706
}
57075707
for (size_t nIn = 0; nIn < assetCommitments.size(); nIn++) {
57085708
if (assetCommitments[nIn].isStr()) {

test/functional/feature_confidential_transactions.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,11 @@ def run_test(self):
495495

496496
# Create one part of the transaction to partially blind
497497
rawtx = self.nodes[0].createrawtransaction(
498-
inputs, {dst_addr2: Decimal("0.01")})
498+
inputs[:1], {dst_addr2: Decimal("0.01")})
499499

500500
# Create another part of the transaction to partially blind
501501
rawtx2 = self.nodes[0].createrawtransaction(
502-
inputs,
502+
inputs[1:],
503503
{dst_addr: Decimal("0.1"), dst_addr3: Decimal("1.0")},
504504
0,
505505
False,
@@ -522,13 +522,13 @@ def run_test(self):
522522
# Combine the transactions
523523

524524
# Blinded, but incomplete transaction.
525-
# 3 inputs and 1 output, but no fee output, and
525+
# 1 inputs and 1 output, but no fee output, and
526526
# it was blinded with 3 asset commitments, that means
527527
# the final transaction should have 3 inputs.
528528
btx = CTransaction()
529529
btx.deserialize(io.BytesIO(hex_str_to_bytes(blindtx)))
530530

531-
# Unblinded transaction, with 3 inputs and 2 outputs.
531+
# Unblinded transaction, with 2 inputs and 2 outputs.
532532
# We will add them to the other transaction to make it complete.
533533
ubtx = CTransaction()
534534
ubtx.deserialize(io.BytesIO(hex_str_to_bytes(rawtx2)))
@@ -537,9 +537,11 @@ def run_test(self):
537537
# on top of inputs and outputs of the blinded, but incomplete transaction.
538538
# We also append empty witness instances to make witness arrays match
539539
# vin/vout arrays
540+
btx.vin.append(ubtx.vin[0])
540541
btx.wit.vtxinwit.append(CTxInWitness())
541542
btx.vout.append(ubtx.vout[0])
542543
btx.wit.vtxoutwit.append(CTxOutWitness())
544+
btx.vin.append(ubtx.vin[1])
543545
btx.wit.vtxinwit.append(CTxInWitness())
544546
btx.vout.append(ubtx.vout[1])
545547
btx.wit.vtxoutwit.append(CTxOutWitness())

0 commit comments

Comments
 (0)