Skip to content

Commit 20c5d37

Browse files
committed
fix: minor fixes
1 parent 7c1fcd1 commit 20c5d37

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/block_proof.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ static bool CheckProofGeneric(const CBlockHeader& block, const uint32_t max_bloc
3333

3434
// Check signature limits for blocks
3535
if (scriptSig.size() > max_block_signature_size) {
36-
assert(!is_dyna);
3736
return false;
3837
} else if (witness.GetSerializedSize() > max_block_signature_size) {
39-
assert(is_dyna);
4038
return false;
4139
}
4240

src/pegins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ bool DecomposePeginWitness(const CScriptWitness& witness, CAmount& value, CAsset
550550
{
551551
const auto& stack = witness.stack;
552552

553-
if (stack.size() < 5) return false;
553+
if (stack.size() != 6) return false;
554554

555555
DataStream stream{stack[0]};
556556
stream >> value;

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ class MemPoolAccept
746746
// calculate the burned subsidy value from the tx
747747
CAmount subsidy = 0;
748748
for (const CTxOut& txout : tx.vout) {
749-
if (txout.scriptPubKey.IsUnspendable() && txout.nAsset.GetAsset() == Params().GetConsensus().pegged_asset && !txout.IsFee()) {
749+
if (txout.scriptPubKey.IsUnspendable() && !txout.IsFee() && txout.nAsset.IsExplicit() && txout.nValue.IsExplicit() && txout.nAsset.GetAsset() == Params().GetConsensus().pegged_asset) {
750750
subsidy += txout.nValue.GetAmount();
751751
}
752752
}

src/wallet/rpc/elements.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,9 @@ RPCHelpMan blindrawtransaction()
13791379
// Vacuous, just return the transaction
13801380
return EncodeHexTx(CTransaction(tx));
13811381
} else if (n_blinded_ins > 0 && num_pubkeys == 0) {
1382+
if (tx.vout.empty()) {
1383+
throw JSONRPCError(RPC_INVALID_PARAMETER, "Unable to blind transaction: transaction has no outputs to balance blinded inputs against.");
1384+
}
13821385
// Blinded inputs need to balanced with something to be valid, make a dummy.
13831386
CTxOut newTxOut(tx.vout.back().nAsset.GetAsset(), 0, CScript() << OP_RETURN);
13841387
tx.vout.push_back(newTxOut);

0 commit comments

Comments
 (0)