@@ -553,15 +553,20 @@ TableSync::ParseSyncAccount(std::string line)
553553
554554 AccountID userAccount;
555555 SecretKey secret_key;
556- if (vec.size () == 2 && (vec[ 1 ][ 0 ] == ' p ' || vec[ 1 ][ 0 ] == ' x ' ) )
556+ if (vec.size () == 2 )
557557 {
558- auto tup = ParseSecret (vec[1 ], " " );
559- if (std::get<2 >(tup))
558+ if ((vec[1 ][0 ] == ' p' || vec[1 ][0 ] == ' x' ))
560559 {
561- userAccount = std::get<0 >(tup);
562- secret_key = std::get<1 >(tup);
560+ auto tup = ParseSecret (vec[1 ], " " );
561+ if (std::get<2 >(tup))
562+ {
563+ userAccount = std::get<0 >(tup);
564+ secret_key = std::get<1 >(tup);
565+ }
566+ return std::make_tuple (*oAccountID, userAccount,secret_key, true );
563567 }
564- return std::make_tuple (*oAccountID, userAccount,secret_key, true );
568+ return std::make_tuple (*oAccountID, beast::zero, SecretKey (), false );
569+
565570 }
566571 else
567572 {
@@ -954,13 +959,12 @@ bool TableSync::isExist(std::list<std::shared_ptr <TableSyncItem>> listTableInf
954959
955960
956961bool
957- TableSync::isSync (std::list<std::shared_ptr<TableSyncItem>> listTableInfo_, AccountID accountID, std::string sTableName , TableSyncItem::SyncTargetType eTargeType)
962+ TableSync::isSync (std::list<std::shared_ptr<TableSyncItem>> listTableInfo_, std::string uTxDBName , TableSyncItem::SyncTargetType eTargeType)
958963{
959964 std::lock_guard lock (mutexlistTable_);
960965 std::list<std::shared_ptr<TableSyncItem>>::iterator iter = std::find_if (listTableInfo_.begin (),listTableInfo_.end (),
961- [accountID, sTableName , eTargeType](std::shared_ptr<TableSyncItem> pItem) {
962- bool bExist = (pItem->GetTableName () == sTableName ) &&
963- (pItem->GetAccount () == accountID) &&
966+ [uTxDBName, eTargeType](std::shared_ptr<TableSyncItem> pItem) {
967+ bool bExist = (pItem->TableNameInDB () == uTxDBName) &&
964968 (pItem->TargetType () == eTargeType) &&
965969 (pItem->GetSyncState () != TableSyncItem::SYNC_DELETING &&
966970 pItem->GetSyncState () != TableSyncItem::SYNC_REMOVE &&
@@ -1845,7 +1849,7 @@ void TableSync::CheckSyncTableTxs(std::shared_ptr<Ledger const> const& ledger)
18451849 bool bDBTableSync = false ;
18461850 if (mapTxDBNam2Sync.find (uTxDBName) == mapTxDBNam2Sync.end ())
18471851 {
1848- bDBTableSync = isSync (listTableInfo_, accountID, tableName , TableSyncItem::SyncTarget_db);
1852+ bDBTableSync = isSync (listTableInfo_, to_string (uTxDBName) , TableSyncItem::SyncTarget_db);
18491853 mapTxDBNam2Sync[uTxDBName] = bDBTableSync;
18501854 }
18511855 else
@@ -1854,7 +1858,7 @@ void TableSync::CheckSyncTableTxs(std::shared_ptr<Ledger const> const& ledger)
18541858 }
18551859 if (!bDBTableSync)
18561860 {
1857- app_.getOPs ().pubTableTxs (accountID, tableName, *pSTTX, std::make_tuple (" db_acctSecretError " , " " , " " ), false );
1861+ app_.getOPs ().pubTableTxs (accountID, tableName, *pSTTX, std::make_tuple (" db_notInSync " , " " , " " ), false );
18581862 break ;
18591863 }
18601864 }
0 commit comments