Skip to content

Commit

Permalink
ignore decoy utxo
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisDemyanko committed Jun 11, 2020
1 parent 1c6099a commit d32e390
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions BeamWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4204,7 +4204,7 @@
CLANG_WARN_ENUM_CONVERSION = NO;
CODE_SIGN_ENTITLEMENTS = Resources/BeamWallet.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = KNU2R94BJK;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -4286,7 +4286,7 @@
CLANG_WARN_ENUM_CONVERSION = NO;
CODE_SIGN_ENTITLEMENTS = Resources/BeamWallet.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = KNU2R94BJK;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
49 changes: 25 additions & 24 deletions BeamWallet/BeamSDK/WalletModel.mm
Original file line number Diff line number Diff line change
Expand Up @@ -246,30 +246,32 @@
@autoreleasepool {
for (const auto& coin : utxos)
{
BMUTXO *bmUTXO = [[BMUTXO alloc] init];
bmUTXO.ID = coin.m_ID.m_Idx;
bmUTXO.stringID = [NSString stringWithUTF8String:coin.toStringID().c_str()];
bmUTXO.amount = coin.m_ID.m_Value;
bmUTXO.realAmount = double(int64_t(coin.m_ID.m_Value)) / Rules::Coin;
bmUTXO.status = (int)coin.m_status;
bmUTXO.maturity = coin.m_maturity;
bmUTXO.confirmHeight = coin.m_confirmHeight;
bmUTXO.statusString = [GetUTXOStatusString(coin) lowercaseString];
bmUTXO.typeString = GetUTXOTypeString(coin);

if (coin.m_createTxId)
{
string createdTxId = to_hex(coin.m_createTxId->data(), coin.m_createTxId->size());
bmUTXO.createTxId = [NSString stringWithUTF8String:createdTxId.c_str()];
}

if (coin.m_spentTxId)
{
string spentTxId = to_hex(coin.m_spentTxId->data(), coin.m_spentTxId->size());
bmUTXO.spentTxId = [NSString stringWithUTF8String:spentTxId.c_str()];
if(coin.m_ID.m_Type != Key::Type::Decoy) {
BMUTXO *bmUTXO = [[BMUTXO alloc] init];
bmUTXO.ID = coin.m_ID.m_Idx;
bmUTXO.stringID = [NSString stringWithUTF8String:coin.toStringID().c_str()];
bmUTXO.amount = coin.m_ID.m_Value;
bmUTXO.realAmount = double(int64_t(coin.m_ID.m_Value)) / Rules::Coin;
bmUTXO.status = (int)coin.m_status;
bmUTXO.maturity = coin.m_maturity;
bmUTXO.confirmHeight = coin.m_confirmHeight;
bmUTXO.statusString = [GetUTXOStatusString(coin) lowercaseString];
bmUTXO.typeString = GetUTXOTypeString(coin);

if (coin.m_createTxId)
{
string createdTxId = to_hex(coin.m_createTxId->data(), coin.m_createTxId->size());
bmUTXO.createTxId = [NSString stringWithUTF8String:createdTxId.c_str()];
}

if (coin.m_spentTxId)
{
string spentTxId = to_hex(coin.m_spentTxId->data(), coin.m_spentTxId->size());
bmUTXO.spentTxId = [NSString stringWithUTF8String:spentTxId.c_str()];
}

[bmUtxos addObject:bmUTXO];
}

[bmUtxos addObject:bmUTXO];
}
}

Expand Down Expand Up @@ -1090,7 +1092,6 @@
}

NSString* WalletModel::GetUTXOTypeString(beam::wallet::Coin coin) {
NSLog(@"%d",coin.m_ID.m_Type);
switch (coin.m_ID.m_Type)
{
case Key::Type::Asset:
Expand Down

0 comments on commit d32e390

Please sign in to comment.