diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 965eebdcf..185641819 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1608,10 +1608,14 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe MaybePushAddress(entry, r.destination); if (wtx.IsCoinBase()) { + int btm; if (wtx.GetDepthInMainChain() < 1) entry.push_back(Pair("category", "orphan")); - else if (wtx.GetBlocksToMaturity() > 0) + else if ((btm = wtx.GetBlocksToMaturity()) > 0) + { entry.push_back(Pair("category", "immature")); + entry.push_back(Pair("blockstomaturity", btm)); + } else entry.push_back(Pair("category", "generate")); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e9b353f3e..0637d3fd4 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3917,8 +3917,9 @@ int CMerkleTx::GetBlocksToMaturity() const return 0; int32_t depth = GetDepthInMainChain(); int32_t ut = UnlockTime(0); - int32_t toMaturity = ut - chainActive.Height() < 0 ? 0 : ut - chainActive.Height(); - ut = COINBASE_MATURITY - depth < 0 ? 0 : COINBASE_MATURITY - depth; + int32_t toMaturity = (ut - chainActive.Height()) < 0 ? 0 : ut - chainActive.Height(); + //printf("depth.%i, unlockTime.%i, toMaturity.%i\n", depth, ut, toMaturity); + ut = (COINBASE_MATURITY - depth) < 0 ? 0 : COINBASE_MATURITY - depth; return(ut < toMaturity ? toMaturity : ut); }