Cleanups to the sha map node format code.

This commit is contained in:
JoelKatz
2012-08-07 19:52:09 -07:00
parent b4e63c3025
commit 8e89335e2b
7 changed files with 46 additions and 41 deletions

View File

@@ -1007,13 +1007,13 @@ void Peer::recvGetLedger(newcoin::TMGetLedger& packet)
reply.add_nodes()->set_nodedata(nData.getDataPtr(), nData.getLength());
if (packet.nodeids().size() != 0)
{
{ // new-style root request
Log(lsINFO) << "Ledger root w/map roots request";
SHAMap::pointer map = ledger->peekAccountStateMap();
if (map)
{
{ // return account state root node if possible
Serializer rootNode(768);
if (map->getRootNode(rootNode, STN_ARF_WIRE))
if (map->getRootNode(rootNode, snfWIRE))
{
reply.add_nodes()->set_nodedata(rootNode.getDataPtr(), rootNode.getLength());
if (ledger->getTransHash().isNonZero())
@@ -1022,7 +1022,7 @@ void Peer::recvGetLedger(newcoin::TMGetLedger& packet)
if (map)
{
rootNode.resize(0);
if (map->getRootNode(rootNode, STN_ARF_WIRE))
if (map->getRootNode(rootNode, snfWIRE))
reply.add_nodes()->set_nodedata(rootNode.getDataPtr(), rootNode.getLength());
}
}