@ -950,9 +950,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
CAmount nValueOut = tx . GetValueOut ( ) ;
CAmount nValueOut = tx . GetValueOut ( ) ;
CAmount nFees = nValueIn - nValueOut ;
CAmount nFees = nValueIn - nValueOut ;
double dPriority = view . GetPriority ( tx , chainActive . Height ( ) ) ;
CAmount inChainInputValue ;
double dPriority = view . GetPriority ( tx , chainActive . Height ( ) , inChainInputValue ) ;
CTxMemPoolEntry entry ( tx , nFees , GetTime ( ) , dPriority , chainActive . Height ( ) , pool . HasNoInputsOf ( tx ) ) ;
CTxMemPoolEntry entry ( tx , nFees , GetTime ( ) , dPriority , chainActive . Height ( ) , pool . HasNoInputsOf ( tx ) , inChainInputValue ) ;
unsigned int nSize = entry . GetTxSize ( ) ;
unsigned int nSize = entry . GetTxSize ( ) ;
// Don't accept it if it can't get into a block
// Don't accept it if it can't get into a block
@ -964,7 +965,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
CAmount mempoolRejectFee = pool . GetMinFee ( GetArg ( " -maxmempool " , DEFAULT_MAX_MEMPOOL_SIZE ) * 1000000 ) . GetFee ( nSize ) ;
CAmount mempoolRejectFee = pool . GetMinFee ( GetArg ( " -maxmempool " , DEFAULT_MAX_MEMPOOL_SIZE ) * 1000000 ) . GetFee ( nSize ) ;
if ( mempoolRejectFee > 0 & & nFees < mempoolRejectFee ) {
if ( mempoolRejectFee > 0 & & nFees < mempoolRejectFee ) {
return state . DoS ( 0 , false , REJECT_INSUFFICIENTFEE , " mempool min fee not met " , false , strprintf ( " %d < %d " , nFees , mempoolRejectFee ) ) ;
return state . DoS ( 0 , false , REJECT_INSUFFICIENTFEE , " mempool min fee not met " , false , strprintf ( " %d < %d " , nFees , mempoolRejectFee ) ) ;
} else if ( GetBoolArg ( " -relaypriority " , DEFAULT_RELAYPRIORITY ) & & nFees < : : minRelayTxFee . GetFee ( nSize ) & & ! AllowFree ( view . GetPriority ( tx , chainActive . Height ( ) + 1 ) ) ) {
} else if ( GetBoolArg ( " -relaypriority " , DEFAULT_RELAYPRIORITY ) & & nFees < : : minRelayTxFee . GetFee ( nSize ) & & ! AllowFree ( entry . GetPriority ( chainActive . Height ( ) + 1 ) ) ) {
// Require that free transactions have sufficient priority to be mined in the next block.
// Require that free transactions have sufficient priority to be mined in the next block.
return state . DoS ( 0 , false , REJECT_INSUFFICIENTFEE , " insufficient priority " ) ;
return state . DoS ( 0 , false , REJECT_INSUFFICIENTFEE , " insufficient priority " ) ;
}
}