diff options
author | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2018-06-27 17:21:07 +0900 |
---|---|---|
committer | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2019-03-14 08:48:46 +0900 |
commit | 6c0a6f73e3672bbec31b63d5046d591599aa21a8 (patch) | |
tree | cfe87fa9f25908a60c4b033b867c240c8ffc0c03 /src/validation.cpp | |
parent | e5efacb941f78645462da1237ed04c75082d3aed (diff) |
wallet/rpc: add maxfeerate parameter to sendrawtransaction
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 358992b74d..e407c082b4 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3130,6 +3130,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); |