Allow IS for all txes, not only for txes with p2pkh and data outputs (#1760)

This commit is contained in:
UdjinM6 2017-12-07 12:43:08 +03:00 committed by GitHub
parent f4502099a4
commit 4802a1fb71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -941,17 +941,6 @@ bool CTxLockRequest::IsValid() const
}
CAmount nValueIn = 0;
CAmount nValueOut = 0;
BOOST_FOREACH(const CTxOut& txout, vout) {
// InstantSend supports normal scripts and unspendable (i.e. data) scripts.
// TODO: Look into other script types that are normal and can be included
if(!txout.scriptPubKey.IsPayToPublicKeyHash() && !txout.scriptPubKey.IsUnspendable()) {
LogPrint("instantsend", "CTxLockRequest::IsValid -- Invalid Script %s", ToString());
return false;
}
nValueOut += txout.nValue;
}
BOOST_FOREACH(const CTxIn& txin, vin) {
@ -980,6 +969,8 @@ bool CTxLockRequest::IsValid() const
return false;
}
CAmount nValueOut = GetValueOut();
if(nValueIn - nValueOut < GetMinFee()) {
LogPrint("instantsend", "CTxLockRequest::IsValid -- did not include enough fees in transaction: fees=%d, tx=%s", nValueOut - nValueIn, ToString());
return false;