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

Function ParseScriptNumber

src/script/miniscript.cpp:408–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408std::optional<int64_t> ParseScriptNumber(const Opcode& in) {
409 if (in.first == OP_0) {
410 return 0;
411 }
412 if (!in.second.empty()) {
413 if (IsPushdataOp(in.first) && !CheckMinimalPush(in.second, in.first)) return {};
414 try {
415 return CScriptNum(in.second, true).GetInt64();
416 } catch(const scriptnum_error&) {}
417 }
418 return {};
419}
420
421int FindNextChar(std::span<const char> sp, const char m)
422{

Callers 1

DecodeScriptFunction · 0.85

Calls 5

IsPushdataOpFunction · 0.85
CheckMinimalPushFunction · 0.85
GetInt64Method · 0.80
CScriptNumClass · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected