mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge #13541: wallet/rpc: sendrawtransaction maxfeerate
7abd2e697cwallet/rpc: add maxfeerate parameter to testmempoolaccept (Karl-Johan Alm)6c0a6f73e3wallet/rpc: add maxfeerate parameter to sendrawtransaction (Karl-Johan Alm)e5efacb941test: Refactor vout fetches in rpc_rawtransaction (Karl-Johan Alm) Pull request description: This adds a new `maxfeerate` parameter to `sendrawtransaction` which forces the node to reject a transaction whose feerate is above the given fee rate. This is a safety harness from shooting yourself in the foot and accidentally overpaying fees. See also #12911. Tree-SHA512: efa50134a7c17c9330cfdfd48ba400e095c0a419cc45e630618d8b44929c25d780d1bb2710c1fbbb6e687eca373505b0338cdaa7f2ff4ca22636d84c31557a2e
This commit is contained in:
@@ -3159,6 +3159,26 @@ static int GetWitnessCommitmentIndex(const CBlock& block)
|
||||
return commitpos;
|
||||
}
|
||||
|
||||
// Compute at which vout of the block's coinbase transaction the signet
|
||||
// signature occurs, or -1 if not found.
|
||||
static int GetSignetSignatureIndex(const CBlock& block)
|
||||
{
|
||||
if (!block.vtx.empty()) {
|
||||
for (size_t o = 0; o < block.vtx[0]->vout.size(); o++) {
|
||||
if (block.vtx[0]->vout[o].scriptPubKey.size() >= 68 // at minimum 64 byte signature plus script/header data
|
||||
&& block.vtx[0]->vout[o].scriptPubKey[0] == OP_RETURN // unspendable
|
||||
&& block.vtx[0]->vout[o].scriptPubKey[1] == block.vtx[0]->vout[o].scriptPubKey.size() - 1 // push the rest
|
||||
&& block.vtx[0]->vout[o].scriptPubKey[2] == 0xec // 's' ^ 0x9f
|
||||
&& block.vtx[0]->vout[o].scriptPubKey[3] == 0xc7 // 'i' ^ 0xae
|
||||
&& block.vtx[0]->vout[o].scriptPubKey[4] == 0xda // 'g' ^ 0xbd
|
||||
&& block.vtx[0]->vout[o].scriptPubKey[5] == 0xa2) { // 'n' ^ 0xcc
|
||||
return (int)o;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams)
|
||||
{
|
||||
int commitpos = GetWitnessCommitmentIndex(block);
|
||||
|
||||
Reference in New Issue
Block a user