mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Add withdraw lock to script/standard.h (and, thus, RPC raw txn)
This commit is contained in:
parent
3e5d2fe86a
commit
6772ca1f25
4 changed files with 12 additions and 1 deletions
|
|
@ -62,6 +62,7 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey, bool&
|
|||
{
|
||||
case TX_NONSTANDARD:
|
||||
case TX_NULL_DATA:
|
||||
case TX_WITHDRAW_LOCK:
|
||||
break;
|
||||
case TX_PUBKEY:
|
||||
keyID = CPubKey(vSolutions[0]).GetID();
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ static bool SignStep(const BaseSignatureCreator& creator, const CScript& scriptP
|
|||
{
|
||||
case TX_NONSTANDARD:
|
||||
case TX_NULL_DATA:
|
||||
case TX_WITHDRAW_LOCK:
|
||||
return false;
|
||||
case TX_PUBKEY:
|
||||
keyID = CPubKey(vSolutions[0]).GetID();
|
||||
|
|
@ -313,6 +314,7 @@ static Stacks CombineSignatures(const CScript& scriptPubKey, const BaseSignature
|
|||
{
|
||||
case TX_NONSTANDARD:
|
||||
case TX_NULL_DATA:
|
||||
case TX_WITHDRAW_LOCK:
|
||||
// Don't know anything about this, assume bigger one is correct:
|
||||
if (sigs1.script.size() >= sigs2.script.size())
|
||||
return sigs1;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ const char* GetTxnOutputType(txnouttype t)
|
|||
case TX_NULL_DATA: return "nulldata";
|
||||
case TX_WITNESS_V0_KEYHASH: return "witness_v0_keyhash";
|
||||
case TX_WITNESS_V0_SCRIPTHASH: return "witness_v0_scripthash";
|
||||
case TX_WITHDRAW_LOCK: return "withdraw";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -94,6 +95,12 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
|
|||
return true;
|
||||
}
|
||||
|
||||
if (scriptPubKey.IsWithdrawLock())
|
||||
{
|
||||
typeRet = TX_WITHDRAW_LOCK;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Scan templates
|
||||
const CScript& script1 = scriptPubKey;
|
||||
BOOST_FOREACH(const PAIRTYPE(txnouttype, CScript)& tplate, mTemplates)
|
||||
|
|
@ -216,7 +223,7 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto
|
|||
vector<valtype> vSolutions;
|
||||
if (!Solver(scriptPubKey, typeRet, vSolutions))
|
||||
return false;
|
||||
if (typeRet == TX_NULL_DATA){
|
||||
if (typeRet == TX_NULL_DATA || typeRet == TX_WITHDRAW_LOCK){
|
||||
// This is data, not addresses
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ enum txnouttype
|
|||
TX_NULL_DATA,
|
||||
TX_WITNESS_V0_SCRIPTHASH,
|
||||
TX_WITNESS_V0_KEYHASH,
|
||||
TX_WITHDRAW_LOCK,
|
||||
};
|
||||
|
||||
class CNoDestination {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue