mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
Sync ledger with wallet.
This commit is contained in:
@@ -270,6 +270,11 @@ Ledger::pointer Ledger::closeLedger(uint64 timeStamp)
|
||||
return Ledger::pointer(new Ledger(*this, timeStamp));
|
||||
}
|
||||
|
||||
void LocalAccount::syncLedger(const uint160& acctID)
|
||||
{
|
||||
setLedgerBalance(theApp->getMasterLedger().getBalance(acctID));
|
||||
}
|
||||
|
||||
bool Ledger::unitTest()
|
||||
{
|
||||
uint160 la1=theApp->getWallet().addFamily(CKey::PassPhraseToKey("This is my payphrase!"), false);
|
||||
|
||||
@@ -122,6 +122,7 @@ public:
|
||||
uint64 getBalance() const;
|
||||
void setLedgerBalance(uint64_t ledgerBalance);
|
||||
void incAcctSeq(uint32 transAcctSeq);
|
||||
void syncLedger(const uint160& acctID);
|
||||
|
||||
CKey::pointer getPublicKey();
|
||||
CKey::pointer getPrivateKey();
|
||||
|
||||
@@ -538,6 +538,9 @@ LocalAccount::pointer Wallet::getNewLocalAccount(const uint160& family)
|
||||
|
||||
LocalAccount::pointer lac(new LocalAccount(fit->second, seq));
|
||||
mAccounts.insert(std::make_pair(acct, lac));
|
||||
|
||||
sl.unlock();
|
||||
lac->syncLedger(acct);
|
||||
return lac;
|
||||
}
|
||||
|
||||
@@ -553,6 +556,9 @@ LocalAccount::pointer Wallet::getLocalAccount(const uint160& family, int seq)
|
||||
|
||||
LocalAccount::pointer lac(new LocalAccount(fit->second, seq));
|
||||
mAccounts.insert(std::make_pair(acct, lac));
|
||||
|
||||
sl.unlock();
|
||||
lac->syncLedger(acct);
|
||||
return lac;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user