<p>There is no way to know which node created a transaction or block, unless they publish that information themselves. Nodes should not have an identity that leaks into transaction or block data.</p>

<p>So banning for relaying invalid blocks or transactions always applies to the peer that gave you the information, based on their IP address. The protocol requires you to validate information before relaying, so you are in violation whenever you pass on invalid data.</p>

CC BY-SA 3.0
2017-05-30T15:25:00.177Z
A node is banned for 24 hours or forever? I checked [Misbehaving()](https://github.com/bitcoin/bitcoin/blob/239d4198645434542b01916dae5eebc7a3a7bbcc/src/main.cpp#L1685) function which makes `state->fShouldBan = true;`. But I could not find any other function that makes `state->fShouldBan = false;`. If it is forever, I guess the node also removes the misbehaving peer from its neighbor list, right?
Önder Gürcan
CC BY-SA 3.0
2017-05-30T13:18:46.630Z
2017-05-30T13:18:46.630Z
Pieter Wuille
<p>When a node receives an invalid transaction or block, as far as I know, it bans the sender for 24 hours. However, I didn't exactly get which sender is banned. Is it the neighbor node that provides the data to this node, or is it the creator of the data (transaction or block)?</p>

<transaction-verification><validation><banscore><block-validity>
Which sender is banned in case of invalid transactions or blocks?
Önder Gürcan
# Which sender is banned in case of invalid transactions or blocks?

(Asked by: username_0 on 2017-05-30)

When a node receives an invalid transaction or block, as far as I know, it bans the sender for 24 hours. However, I didn't exactly get which sender is banned. Is it the neighbor node that provides the data to this node, or is it the creator of the data (transaction or block)?

**Tags:** transaction-verification, validation, banscore, block-validity


---

## 1 answers

### Answer by username_1 on 2017-05-30. Score: 5

There is no way to know which node created a transaction or block, unless they publish that information themselves. Nodes should not have an identity that leaks into transaction or block data.

So banning for relaying invalid blocks or transactions always applies to the peer that gave you the information, based on their IP address. The protocol requires you to validate information before relaying, so you are in violation whenever you pass on invalid data.

> **Comments:**
> **username_0**: A node is banned for 24 hours or forever? I checked [Misbehaving()](https://github.com/bitcoin/bitcoin/blob/239d4198645434542b01916dae5eebc7a3a7bbcc/src/main.cpp#L1685) function which makes `state->fShouldBan = true;`. But I could not find any other function that makes `state->fShouldBan = false;`. If it is forever, I guess the node also removes the misbehaving peer from its neighbor list, right?  

---

