mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge 99b64eec1b into merged_master (Bitcoin PR bitcoin/bitcoin#27232)
This commit is contained in:
commit
ff8ae274d7
2 changed files with 6 additions and 5 deletions
|
|
@ -490,7 +490,7 @@ void SetupServerArgs(ArgsManager& argsman)
|
|||
argsman.AddArg("-externalip=<ip>", "Specify your own public address", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-fixedseeds", strprintf("Allow fixed seeds if DNS seeds don't provide peers (default: %u)", DEFAULT_FIXEDSEEDS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-forcednsseed", strprintf("Always query for peer addresses via DNS lookup (default: %u)", DEFAULT_FORCEDNSSEED), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-listen", "Accept connections from outside (default: 1 if no -proxy or -connect)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-listen", strprintf("Accept connections from outside (default: %u if no -proxy or -connect)", DEFAULT_LISTEN), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-listenonion", strprintf("Automatically create Tor onion service (default: %d)", DEFAULT_LISTEN_ONION), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-maxconnections=<n>", strprintf("Maintain at most <n> connections to peers (default: %u). This limit does not apply to connections manually added via -addnode or the addnode RPC, which have a separate limit of %u.", DEFAULT_MAX_PEER_CONNECTIONS, MAX_ADDNODE_CONNECTIONS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-maxreceivebuffer=<n>", strprintf("Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXRECEIVEBUFFER), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ from test_framework.script_util import (
|
|||
)
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import (
|
||||
assert_approx,
|
||||
assert_equal,
|
||||
assert_greater_than_or_equal,
|
||||
)
|
||||
|
|
@ -58,11 +59,11 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|||
tx.vin = [CTxIn(COutPoint(int(txid, 16), vout))]
|
||||
tx.wit.vtxinwit = [CTxInWitness()]
|
||||
tx.wit.vtxinwit[0].scriptWitness.stack = [bytes(witness_script)]
|
||||
tx.vout = [CTxOut(500000, output_script)]
|
||||
tx.vout = [CTxOut(500000, output_script), CTxOut(500000, b'')] # ELEMENTS fee
|
||||
return tx
|
||||
|
||||
def test_sigops_limit(self, bytes_per_sigop, num_sigops):
|
||||
sigop_equivalent_vsize = ceil(num_sigops * bytes_per_sigop / WITNESS_SCALE_FACTOR)
|
||||
sigop_equivalent_vsize = ceil(num_sigops * bytes_per_sigop / WITNESS_SCALE_FACTOR) + 64 # ELEMENTS
|
||||
self.log.info(f"- {num_sigops} sigops (equivalent size of {sigop_equivalent_vsize} vbytes)")
|
||||
|
||||
# create a template tx with the specified sigop cost in the witness script
|
||||
|
|
@ -84,7 +85,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|||
assert_greater_than_or_equal(sigop_equivalent_vsize, tx.get_vsize())
|
||||
vsize_to_pad = sigop_equivalent_vsize - tx.get_vsize()
|
||||
tx.vout[0].scriptPubKey = CScript([OP_RETURN, b'X'*(256+vsize_to_pad)])
|
||||
assert_equal(sigop_equivalent_vsize, tx.get_vsize())
|
||||
assert_equal(sigop_equivalent_vsize, tx.get_vsize()) # ELEMENTS
|
||||
|
||||
res = self.nodes[0].testmempoolaccept([tx.serialize().hex()])[0]
|
||||
assert_equal(res['allowed'], True)
|
||||
|
|
@ -104,7 +105,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|||
tx.vout[0].scriptPubKey = CScript([OP_RETURN, b'X'*(256+vsize_to_pad-1)])
|
||||
res = self.nodes[0].testmempoolaccept([tx.serialize().hex()])[0]
|
||||
assert_equal(res['allowed'], True)
|
||||
assert_equal(res['vsize'], sigop_equivalent_vsize)
|
||||
assert_approx(res['vsize'], sigop_equivalent_vsize - 1, 1) # ELEMENTS
|
||||
|
||||
def run_test(self):
|
||||
self.wallet = MiniWallet(self.nodes[0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue