Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address problems raised in #935 (0.21 rebase) #984

Merged
5 changes: 4 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ task:
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:focal
memory: 12G # ELEMENTS: need more memory
memory: 16G # ELEMENTS: need more memory
cpu: 4 # ELEMENTS: cirrus wants more CPUs if you want more memory
env:
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"

Expand All @@ -112,6 +113,8 @@ task:
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:focal
memory: 16G # ELEMENTS: need more memory
cpu: 4 # ELEMENTS: cirrus wants more CPUs if you want more memory
env:
FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh"

Expand Down
2 changes: 1 addition & 1 deletion src/bitcoin-tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void SetupBitcoinTxArgs(ArgsManager &argsman)
argsman.AddArg("in=TXID:VOUT(:SEQUENCE_NUMBER)", "Add input to TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
argsman.AddArg("locktime=N", "Set TX lock time to N", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
argsman.AddArg("nversion=N", "Set TX version to N", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
argsman.AddArg("outaddr=VALUE:ADDRESS", "Add address-based output to TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
argsman.AddArg("outaddr=VALUE:ADDRESS(:ASSET)", "Add address-based output to TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
argsman.AddArg("outdata=[VALUE:]DATA", "Add data-based output to TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
argsman.AddArg("outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", "Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS. "
"Optionally add the \"W\" flag to produce a pay-to-witness-script-hash output. "
Expand Down
2 changes: 1 addition & 1 deletion src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman)
argsman.AddArg("-con_connect_genesis_outputs", "Connect outputs in genesis block to utxo database.", ArgsManager::ALLOW_ANY, OptionsCategory::ELEMENTS);
argsman.AddArg("-con_elementsmode", "Use Elements-like instead of Core-like witness encoding. This is required for CA/CT. (default: true)", ArgsManager::ALLOW_ANY, OptionsCategory::ELEMENTS);
argsman.AddArg("-con_blockheightinheader", "Whether the chain includes the block height directly in the header, for easier validation of block height in low-resource environments. (default: true)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-con_genesis_style=<style>", "Use genesis style <style> (default: elements). Results in genesis block compatibility with various networks. Allowed values: elements, bitcoin", true, OptionsCategory::ELEMENTS);
argsman.AddArg("-con_genesis_style=<style>", "Use genesis style <style> (default: elements). Results in genesis block compatibility with various networks. Allowed values: elements, bitcoin", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::ELEMENTS);
argsman.AddArg("-con_signed_blocks", "Signed blockchain. Uses input of `-signblockscript` to define what signatures are necessary to solve it.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-signblockscript", "Signed blockchain enumberance. Only active when `-con_signed_blocks` set to true.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-con_max_block_sig_size", "Max allowed witness data for the signed block header.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
Expand Down
4 changes: 2 additions & 2 deletions src/primitives/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class CTxIn
inline void Serialize(Stream& s) const {
bool fHasAssetIssuance;
COutPoint outpoint;
if (prevout.n == (uint32_t) -1) {
if (!g_con_elementsmode || prevout.n == (uint32_t) -1) {
// Coinbase inputs do not have asset issuances attached
// to them.
fHasAssetIssuance = false;
Expand Down Expand Up @@ -189,7 +189,7 @@ class CTxIn
COutPoint outpoint;
s >> outpoint;

if (outpoint.n == (uint32_t) -1) {
if (!g_con_elementsmode || outpoint.n == (uint32_t) -1) {
// No asset issuance for Coinbase inputs.
fHasAssetIssuance = false;
prevout = outpoint;
Expand Down
4 changes: 2 additions & 2 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ void BitcoinGUI::createActions()
signMessageAction->setStatusTip(tr("Sign messages with your %1 addresses to prove you own them").arg("Liquid"));
verifyMessageAction = new QAction(tr("&Verify message..."), this);
verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified %1 addresses").arg("Liquid"));
m_load_psbt_action = new QAction(tr("&Load PSBT from file..."), this);
m_load_psbt_action = new QAction(tr("&Load PSET from file..."), this);
m_load_psbt_action->setStatusTip(tr("Load Partially Signed Elements Transaction"));
m_load_psbt_clipboard_action = new QAction(tr("Load PSBT from clipboard..."), this);
m_load_psbt_clipboard_action = new QAction(tr("Load PSET from clipboard..."), this);
m_load_psbt_clipboard_action->setStatusTip(tr("Load Partially Signed Elements Transaction from clipboard"));

openRPCConsoleAction = new QAction(tr("Node window"), this);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ void SendCoinsDialog::on_sendButton_clicked()
fileNameSuggestion.append(" - ");
}
QString labelOrAddress = rcp.label.isEmpty() ? rcp.address : rcp.label;
QString amount = GUIUtil::formatAssetAmount(rcp.asset, rcp.asset_amount, bitcoin_unit, BitcoinUnits::BitcoinUnits::SeparatorStyle::STANDARD, true);
QString amount = GUIUtil::formatAssetAmount(rcp.asset, rcp.asset_amount, bitcoin_unit, BitcoinUnits::SeparatorStyle::STANDARD, true);
fileNameSuggestion.append(labelOrAddress + "-" + amount);
first = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static bool GenerateBlock(ChainstateManager& chainman, CBlock& block, uint64_t&
++block.nNonce;
--max_tries;
}
if (max_tries == 0) {
if (max_tries == 0 || ShutdownRequested()) {
return false;
}
if (block.nNonce == std::numeric_limits<uint32_t>::max()) {
Expand Down
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3760,7 +3760,7 @@ static bool ContextualCheckDynaFedHeader(const CBlockHeader& block, BlockValidat
int fedpeg_version = 0;
std::vector<unsigned char> fedpeg_program;
if (!proposed.m_fedpeg_program.IsWitnessProgram(fedpeg_version, fedpeg_program)) {
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "invalid-dyna-fed", "proposed signblockscript must be native segwit scriptPubkey");
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "invalid-dyna-fed", "proposed fedpeg program must be native segwit scriptPubkey");
}

// for v0, fedpegscript's scriptPubKey must match. v1+ is unencumbered.
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3340,7 +3340,7 @@ void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& f
destinations[asset] = dest;
}
} else {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Change address must be a valid address");
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Change address must be either a map or a string");
}

coinControl.destChange = destinations;
Expand Down
5 changes: 1 addition & 4 deletions test/functional/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,9 @@ def gen_return_txouts():
txouts = []
from .messages import CTxOut, CTxOutValue
txout = CTxOut()
txout.nValue = 0
txout.nValue = CTxOutValue(0)
txout.scriptPubKey = hex_str_to_bytes(script_pubkey)
for _ in range(128):
txout = CTxOut()
txout.nValue = CTxOutValue(0)
txout.scriptPubKey = hex_str_to_bytes(script_pubkey)
txouts.append(txout)
return txouts

Expand Down