mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Merge branch 'master' of github.com:jedmccaleb/NewCoin
This commit is contained in:
@@ -116,7 +116,7 @@ void Application::run()
|
||||
rootAddress.setAccountPublic(rootFamilyGenerator, 0);
|
||||
std::cerr << "Root account: " << rootAddress.humanAccountID() << std::endl;
|
||||
|
||||
Ledger::pointer firstLedger(new Ledger(rootAddress, 100000000));
|
||||
Ledger::pointer firstLedger = boost::make_shared<Ledger>(rootAddress, 100000000);
|
||||
assert(!!firstLedger->getAccountState(rootAddress));
|
||||
firstLedger->updateHash();
|
||||
firstLedger->setClosed();
|
||||
|
||||
@@ -48,7 +48,6 @@ void LedgerAcquire::trigger(bool timer)
|
||||
|
||||
if (!mHaveBase)
|
||||
{
|
||||
// WRITEME: Do we need to search for peers?
|
||||
boost::shared_ptr<newcoin::TMGetLedger> tmGL = boost::make_shared<newcoin::TMGetLedger>();
|
||||
tmGL->set_ledgerhash(mHash.begin(), mHash.size());
|
||||
tmGL->set_itype(newcoin::liBASE);
|
||||
@@ -203,15 +202,16 @@ bool LedgerAcquire::takeBase(const std::string& data)
|
||||
{ // Return value: true=normal, false=bad data
|
||||
boost::recursive_mutex::scoped_lock sl(mLock);
|
||||
if (mHaveBase) return true;
|
||||
Ledger* ledger = new Ledger(data);
|
||||
if (ledger->getHash() != mHash)
|
||||
mLedger = boost::make_shared<Ledger>(data);
|
||||
if (mLedger->getHash() != mHash)
|
||||
{
|
||||
delete ledger;
|
||||
mLedger = Ledger::pointer();
|
||||
return false;
|
||||
}
|
||||
mLedger = Ledger::pointer(ledger);
|
||||
mLedger->setAcquiring();
|
||||
mHaveBase = true;
|
||||
if (!mLedger->getTransHash()) mHaveTransactions = true;
|
||||
if (!mLedger->getAccountHash()) mHaveState = true;
|
||||
mLedger->setAcquiring();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user