MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ScriptSize

Method ScriptSize

src/script/descriptor.cpp:1336–1341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1334 bool IsSingleType() const final { return true; }
1335
1336 std::optional<int64_t> ScriptSize() const override {
1337 const auto n_keys = m_pubkey_args.size();
1338 auto op = [](int64_t acc, const std::unique_ptr<PubkeyProvider>& pk) { return acc + 1 + pk->GetSize();};
1339 const auto pubkeys_size{std::accumulate(m_pubkey_args.begin(), m_pubkey_args.end(), int64_t{0}, op)};
1340 return 1 + BuildScript(n_keys).size() + BuildScript(m_threshold).size() + pubkeys_size;
1341 }
1342
1343 std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
1344 const auto sig_size = use_max_sig ? 72 : 71;

Callers

nothing calls this directly

Calls 5

BuildScriptFunction · 0.85
sizeMethod · 0.45
GetSizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected