mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01:00
rpc, refactor: Add getblock_prevout
This change eliminates memory usage spike when compiling with Visual Studio 2022 (at least in Cirrus CI environment). Easy to review using `git diff --color-moved-ws=allow-indentation-change --color-moved=dimmed-zebra`
This commit is contained in:
parent
5abbc9afec
commit
01d95a3964
1 changed files with 24 additions and 20 deletions
|
@ -598,6 +598,29 @@ static CBlockUndo GetUndoChecked(BlockManager& blockman, const CBlockIndex* pblo
|
||||||
return blockUndo;
|
return blockUndo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const RPCResult getblock_vin{
|
||||||
|
RPCResult::Type::ARR, "vin", "",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::OBJ, "", "",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::ELISION, "", "The same output as verbosity = 2"},
|
||||||
|
{RPCResult::Type::OBJ, "prevout", "(Only if undo information is available)",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::BOOL, "generated", "Coinbase or not"},
|
||||||
|
{RPCResult::Type::NUM, "height", "The height of the prevout"},
|
||||||
|
{RPCResult::Type::NUM, "value", "The value in " + CURRENCY_UNIT},
|
||||||
|
{RPCResult::Type::OBJ, "scriptPubKey", "",
|
||||||
|
{
|
||||||
|
{RPCResult::Type::STR, "asm", "The asm"},
|
||||||
|
{RPCResult::Type::STR, "hex", "The hex"},
|
||||||
|
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
|
||||||
|
{RPCResult::Type::STR, "type", "The type (one of: " + GetAllOutputTypes() + ")"},
|
||||||
|
}},
|
||||||
|
}},
|
||||||
|
}},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
static RPCHelpMan getblock()
|
static RPCHelpMan getblock()
|
||||||
{
|
{
|
||||||
return RPCHelpMan{"getblock",
|
return RPCHelpMan{"getblock",
|
||||||
|
@ -657,26 +680,7 @@ static RPCHelpMan getblock()
|
||||||
{
|
{
|
||||||
{RPCResult::Type::OBJ, "", "",
|
{RPCResult::Type::OBJ, "", "",
|
||||||
{
|
{
|
||||||
{RPCResult::Type::ARR, "vin", "",
|
getblock_vin,
|
||||||
{
|
|
||||||
{RPCResult::Type::OBJ, "", "",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::ELISION, "", "The same output as verbosity = 2"},
|
|
||||||
{RPCResult::Type::OBJ, "prevout", "(Only if undo information is available)",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::BOOL, "generated", "Coinbase or not"},
|
|
||||||
{RPCResult::Type::NUM, "height", "The height of the prevout"},
|
|
||||||
{RPCResult::Type::NUM, "value", "The value in " + CURRENCY_UNIT},
|
|
||||||
{RPCResult::Type::OBJ, "scriptPubKey", "",
|
|
||||||
{
|
|
||||||
{RPCResult::Type::STR, "asm", "The asm"},
|
|
||||||
{RPCResult::Type::STR, "hex", "The hex"},
|
|
||||||
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
|
|
||||||
{RPCResult::Type::STR, "type", "The type (one of: " + GetAllOutputTypes() + ")"},
|
|
||||||
}},
|
|
||||||
}},
|
|
||||||
}},
|
|
||||||
}},
|
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
|
|
Loading…
Add table
Reference in a new issue