mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
walletrpc: disallow locking with internal ID
The internal lock ID that the wallet kit subserver uses to lock inputs for itself shouldn't be allowed to be used when locking inputs manually over the RPC.
This commit is contained in:
parent
6229609be7
commit
9a063355e2
1 changed files with 6 additions and 0 deletions
|
@ -329,6 +329,12 @@ func (w *WalletKit) LeaseOutput(ctx context.Context,
|
|||
return nil, errors.New("id must be 32 random bytes")
|
||||
}
|
||||
|
||||
// Don't allow our internal ID to be used externally for locking. Only
|
||||
// unlocking is allowed.
|
||||
if lockID == LndInternalLockID {
|
||||
return nil, errors.New("reserved id cannot be used")
|
||||
}
|
||||
|
||||
op, err := unmarshallOutPoint(req.Outpoint)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Reference in a new issue