Skip to content

Commit

Permalink
fix payout tx detect, add BRD share feature, remove WGR as selectable…
Browse files Browse the repository at this point in the history
… currency, build 235
  • Loading branch information
MIPPL committed Oct 18, 2019
1 parent aecde92 commit 6e05bc2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void onClick(View v) {
QRUtils.share("sms:", getActivity(), cryptoUri.toString());
}
});
/*

shareButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand All @@ -189,8 +189,8 @@ public void onClick(View v) {
QRUtils.sendShareIntent(getActivity(), cryptoUri.toString(), cryptoRequest.getAddress(true));
}
});
*/

/*
shareButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand All @@ -199,7 +199,7 @@ public void onClick(View v) {
showShareButtons(shareButtonsShown);
}
});

*/
mAddress.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ else if (confirms == 3)
String txDescription = "", txDate = "";
long eventID = 0;
long nCurrentHeight = BRSharedPrefs.getLastBlockHeight(mContext, wallet.getIso(mContext));
boolean isNormalTx = true;

if (item.isCoinbase() && item.getBlockHeight() != Integer.MAX_VALUE) { // then payout reward
boolean immature = (nCurrentHeight-item.getBlockHeight()) <= PAYOUT_MATURITY;
Expand All @@ -266,10 +267,12 @@ else if (confirms == 3)
txDescription = String.format("Event #%d: info not avalable", eventID);
}
txDate = String.format("PAYOUT Event #%d", eventID);
} else {
}
else {
txDescription = String.format("Result not avalable at height %d", item.getBlockHeight() - 1);
txDate = "PAYOUT";
}
isNormalTx=false;
if (immature) txDate+=" " + strMatureInfo;
} else if (item.getBetEntity()!=null) { // outgoing bet
eventID = item.getBetEntity().getEventID();
Expand All @@ -281,8 +284,11 @@ else if (confirms == 3)
txDescription = String.format("Event #%d: info not avalable", eventID);
txDate = String.format("BET %s", item.getBetEntity().getOutcome().toString());
}
isNormalTx=false;
}
else { // regular tx


if (isNormalTx) { // regular tx
if (level > 4) {
txDescription = !commentString.isEmpty() ? commentString : (!received ? "sent to " : "received via ") + wallet.decorateAddress(mContext, item.getToRecipient(wallet, received));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ public List<CurrencyEntity> getAllCurrencies(Context app, String iso) {
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
CurrencyEntity curEntity = cursorToCurrency(cursor);
currencies.add(curEntity);
if ( !curEntity.code.equals(iso.toUpperCase()) ) {
currencies.add(curEntity);
}
cursor.moveToNext();
}
// make sure to close the cursor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public List<TxUiHolder> getTxUiHolders() {
tx.getOutputAddresses(), tx.getInputAddresses(),
getWallet().getBalanceAfterTransaction(tx), (int) tx.getSize(),
getWallet().getTransactionAmount(tx), getWallet().transactionIsValid(tx)
, (tx.getInputAddresses().length==1 && tx.getInputAddresses()[0].length()==0) ); // is coinbase or POS
, (tx.getInputAddresses().length==1 && tx.getOutputAddresses().length>=1 && tx.getInputAddresses()[0].length()==0 && tx.getOutputAddresses()[0].length()==0) ); // is coinbase or POS

BetEntity be = WagerrOpCodeManager.getEventIdFromCoreTx(tx);
txUiHolder.setBetEntity(be);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/jni/breadwallet-core

0 comments on commit 6e05bc2

Please sign in to comment.