Add blocks to maturity in transaction JSON for listtransactions RPC API
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user