Merge #8149: Segregated witness rebased
f852813BIP9 parameters for testnet (Johnson Lau)070dbc4--- [SEGWIT] begin: deployment --- (Pieter Wuille)fdb43df[qa] Add GetTransactionSigOpCost unit tests (Jonas Nick)d846e02[qa] script_tests: witness tests can specify tx amount (Suhas Daftuar)330b0f3[qa] p2p segwit tests (Suhas Daftuar)4f7ff00[qa] Add rpc test for segwit (Alex Morcos)66cca79[qa] Autogeneration support for witness in script_tests (Pieter Wuille)06d3805[qa] Add segwit support to script_tests (Pieter Wuille)00f46cb[qa] Add transaction tests for segwit (NicolasDorier)0aa9207[qa] Witness version 0 signing unit tests (Pieter Wuille)978e200--- [SEGWIT] begin: tests --- (Pieter Wuille)745eb67[RPC] signrawtransaction can sign P2WSH (NicolasDorier)f4691ab[RPC] Add wallet support for witness transactions (using P2SH) (Pieter Wuille)605e847BIP143: Signing logic (Pieter Wuille)9757b57--- [SEGWIT] begin: wallet --- (Pieter Wuille)af87a67Do not use compact blocks when segwit is enabled (Pieter Wuille)6032f69Add rewind logic to deal with post-fork software updates (Pieter Wuille)b7dbeb2[libconsensus] Script verification API with amounts (Thomas Kerin)2b1f6f9BIP141: Other consensus critical limits, and BIP145 (Pieter Wuille)7c4bf77[RPC] Return witness data in blockchain RPCs (Johnson Lau)3dd4102BIP143: Verification logic (Pieter Wuille)0ef1dd3Refactor script validation to observe amounts (Pieter Wuille)b8a9749BIP144: Handshake and relay (receiver side) (Pieter Wuille)8b49040BIP141: Commitment structure and deployment (Pieter Wuille)449f9b8BIP141: Witness program (Pieter Wuille)7030d9eBIP144: Serialization, hashes, relay (sender side) (Pieter Wuille)ecacfd9--- [SEGWIT] begin: P2P/node/consensus --- (Pieter Wuille)
This commit is contained in:
@@ -2334,33 +2334,37 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
|
||||
{
|
||||
bool signSuccess;
|
||||
const CScript& scriptPubKey = coin.first->vout[coin.second].scriptPubKey;
|
||||
CScript& scriptSigRes = txNew.vin[nIn].scriptSig;
|
||||
SignatureData sigdata;
|
||||
if (sign)
|
||||
signSuccess = ProduceSignature(TransactionSignatureCreator(this, &txNewConst, nIn, SIGHASH_ALL), scriptPubKey, scriptSigRes);
|
||||
signSuccess = ProduceSignature(TransactionSignatureCreator(this, &txNewConst, nIn, coin.first->vout[coin.second].nValue, SIGHASH_ALL), scriptPubKey, sigdata);
|
||||
else
|
||||
signSuccess = ProduceSignature(DummySignatureCreator(this), scriptPubKey, scriptSigRes);
|
||||
signSuccess = ProduceSignature(DummySignatureCreator(this), scriptPubKey, sigdata);
|
||||
|
||||
if (!signSuccess)
|
||||
{
|
||||
strFailReason = _("Signing transaction failed");
|
||||
return false;
|
||||
} else {
|
||||
UpdateTransaction(txNew, nIn, sigdata);
|
||||
}
|
||||
|
||||
nIn++;
|
||||
}
|
||||
|
||||
unsigned int nBytes = ::GetSerializeSize(txNew, SER_NETWORK, PROTOCOL_VERSION);
|
||||
unsigned int nBytes = GetVirtualTransactionSize(txNew);
|
||||
|
||||
// Remove scriptSigs if we used dummy signatures for fee calculation
|
||||
if (!sign) {
|
||||
BOOST_FOREACH (CTxIn& vin, txNew.vin)
|
||||
vin.scriptSig = CScript();
|
||||
txNew.wit.SetNull();
|
||||
}
|
||||
|
||||
// Embed the constructed transaction data in wtxNew.
|
||||
*static_cast<CTransaction*>(&wtxNew) = CTransaction(txNew);
|
||||
|
||||
// Limit size
|
||||
if (nBytes >= MAX_STANDARD_TX_SIZE)
|
||||
if (GetTransactionCost(txNew) >= MAX_STANDARD_TX_COST)
|
||||
{
|
||||
strFailReason = _("Transaction too large");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user