/** * Thread: Client thread */ private boolean accountIsUnfunded() { return account.getAccountRoot().getBalance().isZero(); }
/** * Thread: Client thread */ private boolean accountIsUnfunded() { return account.getAccountRoot().getBalance().isZero(); }
private static void printTrade(TransactionResult tr, Offer before, Offer after) { // Executed define non negative amount of Before - After STObject executed = after.executed(before); Amount takerGot = executed.get(Amount.TakerGets); // Only print trades that executed if (!takerGot.isZero()) { print("In {0} tx: {1}, Offer owner {2}, was paid: {3}, gave: {4} ", tr.transactionType(), tr.hash, before.account(), executed.get(Amount.TakerPays), takerGot); } } }
@Override public void toBytesSink(BytesSink to) { UInt64 man = mantissa(); if (isNative()) { if (!isNegative()) { man = man.or(BINARY_FLAG_IS_NON_NEGATIVE_NATIVE); } to.add(man.toByteArray()); } else { int exponent = exponent(); UInt64 packed; if (isZero()) { packed = BINARY_FLAG_IS_IOU; } else if (isNegative()) { packed = man.or(new UInt64(512 + 0 + 97 + exponent).shiftLeft(64 - 10)); } else { packed = man.or(new UInt64(512 + 256 + 97 + exponent).shiftLeft(64 - 10)); } to.add(packed.toByteArray()); to.add(currency.bytes()); to.add(issuer.bytes()); } }