mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 10:42:46 +01:00
Log reason for non-standard transaction rejection
This commit is contained in:
@@ -74,6 +74,7 @@ BOOST_AUTO_TEST_CASE(sign)
|
||||
}
|
||||
|
||||
CTransaction txFrom; // Funding transaction:
|
||||
string reason;
|
||||
txFrom.vout.resize(8);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -82,7 +83,7 @@ BOOST_AUTO_TEST_CASE(sign)
|
||||
txFrom.vout[i+4].scriptPubKey = standardScripts[i];
|
||||
txFrom.vout[i+4].nValue = COIN;
|
||||
}
|
||||
BOOST_CHECK(IsStandardTx(txFrom));
|
||||
BOOST_CHECK(IsStandardTx(txFrom, reason));
|
||||
|
||||
CTransaction txTo[8]; // Spending transactions
|
||||
for (int i = 0; i < 8; i++)
|
||||
@@ -167,13 +168,14 @@ BOOST_AUTO_TEST_CASE(set)
|
||||
}
|
||||
|
||||
CTransaction txFrom; // Funding transaction:
|
||||
string reason;
|
||||
txFrom.vout.resize(4);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
txFrom.vout[i].scriptPubKey = outer[i];
|
||||
txFrom.vout[i].nValue = CENT;
|
||||
}
|
||||
BOOST_CHECK(IsStandardTx(txFrom));
|
||||
BOOST_CHECK(IsStandardTx(txFrom, reason));
|
||||
|
||||
CTransaction txTo[4]; // Spending transactions
|
||||
for (int i = 0; i < 4; i++)
|
||||
@@ -189,7 +191,7 @@ BOOST_AUTO_TEST_CASE(set)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
BOOST_CHECK_MESSAGE(SignSignature(keystore, txFrom, txTo[i], 0), strprintf("SignSignature %d", i));
|
||||
BOOST_CHECK_MESSAGE(IsStandardTx(txTo[i]), strprintf("txTo[%d].IsStandard", i));
|
||||
BOOST_CHECK_MESSAGE(IsStandardTx(txTo[i], reason), strprintf("txTo[%d].IsStandard", i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user