mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge branch 'master' into elements-22-rc4
This commit is contained in:
commit
48dd32a609
6 changed files with 29 additions and 12 deletions
|
|
@ -536,7 +536,7 @@ ds['.']['icvp'] = icvp
|
|||
ds['.']['vSrn'] = ('long', 1)
|
||||
|
||||
ds['Applications']['Iloc'] = (370, 156)
|
||||
ds['Bitcoin-Qt.app']['Iloc'] = (128, 156)
|
||||
ds['Elements-Qt.app']['Iloc'] = (128, 156)
|
||||
|
||||
ds.flush()
|
||||
ds.close()
|
||||
|
|
|
|||
|
|
@ -476,6 +476,9 @@ BlindingStatus BlindPSBT(PartiallySignedTransaction& psbt, std::map<uint32_t, st
|
|||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
input_asset_blinders.emplace_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
28
src/psbt.cpp
28
src/psbt.cpp
|
|
@ -123,13 +123,26 @@ CMutableTransaction PartiallySignedTransaction::GetUnsignedTx(bool force_unblind
|
|||
txin.nSequence = input.sequence.value_or(max_sequence);
|
||||
txin.assetIssuance.assetBlindingNonce = input.m_issuance_blinding_nonce;
|
||||
txin.assetIssuance.assetEntropy = input.m_issuance_asset_entropy;
|
||||
if (input.m_issuance_value != std::nullopt && input.m_issuance_inflation_keys_amount != std::nullopt && force_unblinded) {
|
||||
// If there is a commitment we should set the value to the commitment unless we are forcing unblinded.
|
||||
// If we are forcing unblinded but there is no value, we just use the commitment.
|
||||
if (input.m_issuance_value != std::nullopt && (input.m_issuance_value_commitment.IsNull() || force_unblinded)) {
|
||||
txin.assetIssuance.nAmount.SetToAmount(*input.m_issuance_value);
|
||||
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_inflation_keys_amount);
|
||||
} else {
|
||||
}
|
||||
else if(!input.m_issuance_value_commitment.IsNull()) {
|
||||
txin.assetIssuance.nAmount = input.m_issuance_value_commitment;
|
||||
}
|
||||
else {
|
||||
txin.assetIssuance.nAmount.SetNull();
|
||||
}
|
||||
if (input.m_issuance_inflation_keys_amount != std::nullopt && (input.m_issuance_inflation_keys_commitment.IsNull() || force_unblinded)) {
|
||||
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_value);
|
||||
}
|
||||
else if(!input.m_issuance_inflation_keys_commitment.IsNull()) {
|
||||
txin.assetIssuance.nInflationKeys = input.m_issuance_inflation_keys_commitment;
|
||||
}
|
||||
else {
|
||||
txin.assetIssuance.nInflationKeys.SetNull();
|
||||
}
|
||||
mtx.vin.push_back(txin);
|
||||
}
|
||||
for (const PSBTOutput& output : outputs) {
|
||||
|
|
@ -531,12 +544,9 @@ bool PSBTOutput::Merge(const PSBTOutput& output)
|
|||
CTxOut PSBTOutput::GetTxOut() const
|
||||
{
|
||||
assert(script != std::nullopt);
|
||||
if (!m_value_commitment.IsNull() && !m_asset_commitment.IsNull()) {
|
||||
return CTxOut(m_asset_commitment, m_value_commitment, *script);
|
||||
}
|
||||
assert(amount != std::nullopt);
|
||||
assert(!m_asset.IsNull());
|
||||
return CTxOut(CConfidentialAsset(CAsset(m_asset)), CConfidentialValue(*amount), *script);
|
||||
assert(amount != std::nullopt || !m_value_commitment.IsNull());
|
||||
assert(!m_asset.IsNull() || !m_asset_commitment.IsNull());
|
||||
return CTxOut(!m_asset_commitment.IsNull() ? m_asset_commitment : CAsset(m_asset), !m_value_commitment.IsNull() ? m_value_commitment : CConfidentialValue(*amount), *script);
|
||||
}
|
||||
|
||||
bool PSBTOutput::IsBlinded() const
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public:
|
|||
currentSingleStep = 100000000; // a whole asset
|
||||
}
|
||||
}
|
||||
val.second = val.second + steps * singleStep;
|
||||
val.second = val.second + steps * currentSingleStep;
|
||||
val.second = qMax(val.second, CAmount(0));
|
||||
val.second = qBound(m_min_amount, val.second, m_max_amount);
|
||||
// FIXME: Add this back in when assets can have > MAX_MONEY
|
||||
|
|
|
|||
|
|
@ -3173,7 +3173,7 @@ static bool VerifyWitnessProgram(const CScriptWitness& witness, int witversion,
|
|||
}
|
||||
execdata.m_tapleaf_hash_init = true;
|
||||
if ((control[0] & TAPROOT_LEAF_MASK) == TAPROOT_LEAF_TAPSCRIPT) {
|
||||
// Tapscript (leaf version 0xc0)
|
||||
// Tapscript (leaf version 0xc4)
|
||||
execdata.m_validation_weight_left = ::GetSerializeSize(witness.stack, PROTOCOL_VERSION) + VALIDATION_WEIGHT_OFFSET;
|
||||
execdata.m_validation_weight_left_init = true;
|
||||
return ExecuteWitnessScript(stack, exec_script, flags, SigVersion::TAPSCRIPT, checker, execdata, serror);
|
||||
|
|
|
|||
|
|
@ -2048,11 +2048,15 @@ TransactionError CWallet::SignPSBT(PartiallySignedTransaction& psbtx, bool& comp
|
|||
txin.assetIssuance.nAmount = input.m_issuance_value_commitment;
|
||||
} else if (input.m_issuance_value) {
|
||||
txin.assetIssuance.nAmount.SetToAmount(*input.m_issuance_value);
|
||||
} else {
|
||||
txin.assetIssuance.nAmount.SetNull();
|
||||
}
|
||||
if (!input.m_issuance_inflation_keys_commitment.IsNull()) {
|
||||
txin.assetIssuance.nInflationKeys = input.m_issuance_inflation_keys_commitment;
|
||||
} else if (input.m_issuance_inflation_keys_amount) {
|
||||
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_inflation_keys_amount);
|
||||
} else {
|
||||
txin.assetIssuance.nInflationKeys.SetNull();
|
||||
}
|
||||
if (!input.m_issuance_rangeproof.empty()) {
|
||||
txinwit.vchIssuanceAmountRangeproof = input.m_issuance_rangeproof;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue