mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Simplify SHAMapTreeNode APIs:
- Provide separate functions for serializing depending on whether one wants a "wire" version of a node, or one suitable for hashing. - Remove unused functions
This commit is contained in:
@@ -2734,24 +2734,21 @@ PeerImp::getLedger(std::shared_ptr<protocol::TMGetLedger> const& m)
|
||||
{
|
||||
// return account state root node if possible
|
||||
Serializer rootNode(768);
|
||||
if (stateMap.getRootNode(rootNode, snfWIRE))
|
||||
|
||||
stateMap.serializeRoot(rootNode);
|
||||
reply.add_nodes()->set_nodedata(
|
||||
rootNode.getDataPtr(), rootNode.getLength());
|
||||
|
||||
if (ledger->info().txHash != beast::zero)
|
||||
{
|
||||
reply.add_nodes()->set_nodedata(
|
||||
rootNode.getDataPtr(), rootNode.getLength());
|
||||
|
||||
if (ledger->info().txHash != beast::zero)
|
||||
auto const& txMap = ledger->txMap();
|
||||
if (txMap.getHash() != beast::zero)
|
||||
{
|
||||
auto const& txMap = ledger->txMap();
|
||||
rootNode.erase();
|
||||
|
||||
if (txMap.getHash() != beast::zero)
|
||||
{
|
||||
rootNode.erase();
|
||||
|
||||
if (txMap.getRootNode(rootNode, snfWIRE))
|
||||
reply.add_nodes()->set_nodedata(
|
||||
rootNode.getDataPtr(),
|
||||
rootNode.getLength());
|
||||
}
|
||||
txMap.serializeRoot(rootNode);
|
||||
reply.add_nodes()->set_nodedata(
|
||||
rootNode.getDataPtr(), rootNode.getLength());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user