JoelKatz

Untitled

Sep 30th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.34 KB | None | 0 0
  1. Hotfix to keep the Ripple server from having to reprocess ledgers it built locally as a result of its consensus engine. This fix applies to all pre-releases of 0.12, all releases of 0.12, all release candidates of 0.13, and the current develop branch. (Alternatively, you just use JoelKatz/stable-wip, though that branch is not always stable.)
  2.  
  3. This change seems obviously harmless and seems to obviously correct a bug, but it has not been extensively tested for stability. It should be applied by hand, adding one line to LegerConsensus::accept. Your LedgerConsensus.cpp file may be in a different directory depending on the version of the code you have.
  4.  
  5. diff --git a/src/ripple_app/consensus/LedgerConsensus.cpp b/src/ripple_app/consensus/LedgerConsensus.cpp
  6. index 9f3b760..11437b4 100644
  7. --- a/src/ripple_app/consensus/LedgerConsensus.cpp
  8. +++ b/src/ripple_app/consensus/LedgerConsensus.cpp
  9. @@ -1268,6 +1268,7 @@ void LedgerConsensus::accept (SHAMap::ref set, LoadEvent::pointer)
  10.          newLCL->setAccepted (closeTime, mCloseResolution, closeTimeCorrect);
  11.          newLCL->updateHash ();
  12.          newLCL->setImmutable ();
  13. +        getApp().getLedgerMaster().storeLedger(newLCL);
  14.  
  15.          WriteLog (lsDEBUG, LedgerConsensus) << "Report: NewL  = " << newLCL->getHash () << ":" << newLCL->getLedgerSeq ();
  16.          uint256 newLCLHash = newLCL->getHash ();
Advertisement
Add Comment
Please, Sign In to add comment